Python 在 Pycharm 2016.3 中安装 pip
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41073620/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Installing pip in Pycharm 2016.3
提问by Imperator123
I upgraded to the new version of Pycharm. In the terminal, it says bash-3.2$
instead of my username. When I tried to install a library, it said that pip command is not found:
我升级到新版本的 Pycharm。在终端中,它显示bash-3.2$
而不是我的用户名。当我尝试安装一个库时,它说找不到 pip 命令:
bash: pip: command not found
So I installed pip:
所以我安装了pip:
bash-3.2$ sudo easy_install pip
Searching for pip
Best match: pip 8.1.2
pip 8.1.2 is already the active version in easy-install.pth
Installing pip script to /usr/local/bin
Installing pip3.5 script to /usr/local/bin
Installing pip3 script to /usr/local/bin
Using /Library/Python/2.7/site-packages
Processing dependencies for pip
Finished processing dependencies for pip</i>
Okay, now all I have to do is use pip to install a library, right?
好的,现在我要做的就是使用 pip 安装一个库,对吗?
But then, this happens:
但是,这发生了:
bash-3.2$ pip install pandas
bash: pip: command not found
I don't understand what I have to do to actually install pip. Or should I use sudo easy_install [library]
?
我不明白我必须做什么才能实际安装 pip。还是我应该使用sudo easy_install [library]
?
回答by Irmen de Jong
I know that this is not precisely what you're asking, but PyCharm has its own built-in package manager. You should not have to use pip manually.
我知道这不是你要问的,但 PyCharm 有自己的内置包管理器。您不必手动使用 pip。
File->Settings->Project Interpreter https://www.jetbrains.com/help/pycharm/2016.3/installing-uninstalling-and-upgrading-packages.html
文件->设置->项目解释器 https://www.jetbrains.com/help/pycharm/2016.3/installing-uninstalling-and-upgrading-packages.html
there you can manage the installed packages for the selected Python interpreter or virtualenv.
在那里您可以管理所选 Python 解释器或 virtualenv 的已安装包。
回答by Bodhi94
Run this command on your terminal. pip will be installed without any issue.
在终端上运行此命令。pip 将毫无问题地安装。
sudo [your package manager] install python-pip python-dev build-essential
If it is not solved. The problem might be PATH
problem.
Type echo $PATH
on terminal. There should be /usr/local/bin
in the output. If it is not type PATH=$PATH:/usr/local/bin
to add /usr/local/bin
to PATH
如果没有解决。问题可能是PATH
问题。键入echo $PATH
的终端。/usr/local/bin
输出中应该有。如果不是类型PATH=$PATH:/usr/local/bin
添加/usr/local/bin
到PATH