在Visual Studio的Chromebook上安装Python包装
我正在尝试将 python 包(特别是 pandas)安装到 chromebook 的 Linux 虚拟机上的 Visual Studio 代码中。我尝试了很多不同的方法,但似乎都不起作用:尝试使用 pip install pandas
会导致 bash: pip: command not find
。我不知道实际的 python 解释器位于哪里,所以我无法找到源代码。我以为我没有使用正确的终端,但唯一的其他选项是 JavaScript 调试终端。我做错了什么?有可能吗?
I'm trying to install a python package (specifically pandas) into Visual Studio code on a chromebook's linux virtual machine. I've tried many different things but none of them seem to work: trying to use pip install pandas
results in bash: pip: command not found
. I have no idea where the actual python interpreter is located, so I can't go to the source. I thought it was that I wasn't using the correct terminal, but the only other option is JavaScript Debug Terminal
. What am I doing wrong? Is it even possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
PIP是Python软件包管理工具,它提供了查找,下载,安装和卸载Python软件包的功能。但是,该工具不包括在系统中,需要手动安装。这是官方网站 pip,其中包含安装说明。
Pip is a python package management tool, which provides the functions of finding, downloading, installing and uninstalling Python packages. However, this tool is not included in the system and needs to be installed manually. Here is the official website of PIP, which contains installation instructions.
您可以做:
但是,这与所有模块都不适用。
You can do:
however, this does not work with all modules.
我的 Chromebook 运行的是 Debian,并且默认安装了托管的最小 Python3。
打开终端并输入
cat /etc/issue
来确认您的发行版。如果返回的字符串包含Debian,您就可以按照这些说明进行操作。任何其他发行版和您的里程都会有所不同。
您需要完整版本的 Python:
sudo apt install python3-full
Pip 在此环境中不起作用。 Pipx 可以。
立即重新启动终端以更新您的路径。
您现在可以使用 pipx 一次安装一个软件包。 (Pipx 不会自动安装软件包依赖项)
pipx install; --include-deps
似乎不支持在一个命令中安装多个软件包 (
pipx install
)。 (但我现在有 20 分钟的 pipx 经验。)My Chromebook is running Debian and has a managed, minimal Python3 install as a default.
Confirm your distro by opening a terminal and typing
cat /etc/issue
.If the returned string contains Debian you're good to go with these instructions. Any other distro and your mileage will vary.
You'll need the full version of Python:
sudo apt install python3-full
Pip doesn't work in this environment. Pipx does.
Restart your Terminal now to update your path.
You can now install packages one at a time using pipx. (Pipx does not automatically install packages dependencies)
pipx install <package_name> --include-deps
Installing multiple packages in one command (
pipx install <p1> <p2>
) does not appear to be supported. (But I have 20 minutes experience with pipx right now.)