[英]Permission issues while using and installing Python packages
How to get rid of the permission issues while using and installing Python packages? 如何在使用和安装Python软件包时摆脱权限问题?
When I am trying to install any package using the PyCharm interpreter configuration, it says: 当我尝试使用PyCharm解释器配置安装任何软件包时,它说:
Error: Python packaging tool 'pip' not found
错误:找不到Python打包工具“ pip”
I am sure that pip is already installed on my Ubuntu machine as I installed it at first using: 我确定在我首先使用以下方法安装Ubuntu机器时就已经安装了pip:
sudo apt-get install python-pip
Are you using a virtualenv or your global python? 您使用的是virtualenv还是全局python? Check if your Pycharm is configurated correctly (so, if you use a virtualenv configure it to use it, check here )
检查您的Pycharm是否配置正确(因此,如果您使用virtualenv对其进行配置以使用它, 请在此处检查 )
Go to Project settings
> select your project and in the Python interpreter
select your python directory 转到
Project settings
>选择项目,然后在Python interpreter
选择您的python目录
Can you try to execute pip
in your terminal and see if it work? 您可以尝试在终端中执行
pip
并查看其是否有效吗? (Try pip install Django
) (尝试
pip install Django
)
try install pip with: 尝试使用以下方法安装pip:
sudo apt install python-pip
or install with easy_install 或使用easy_install进行安装
easy_install pip
also can install package with: 也可以通过以下方式安装软件包:
easy_install packagename
see this https://askubuntu.com/questions/748264/error-python-packaging-tool-pip-not-found 看到这个https://askubuntu.com/questions/748264/error-python-packaging-tool-pip-not-found
if it not work you can try it: sudo chmod -R a+rX /usr/local/lib/python2.7/dist-packages/ sudo chmod -R a+rX /usr/local/lib/python3.3/dist-packages/
如果它不起作用,则可以尝试:
sudo chmod -R a+rX /usr/local/lib/python2.7/dist-packages/ sudo chmod -R a+rX /usr/local/lib/python3.3/dist-packages/
Source https://stackoverflow.com/a/22423673/4941927 来源https://stackoverflow.com/a/22423673/4941927
Use commands below to get pip installed: 使用以下命令安装pip:
curl https://bootstrap.pypa.io/ez_setup.py -o - | sudo python
sudo easy_install pip
如果您使用的是Python3,请确保安装python3-pip
而不是python-pip
。
sudo apt-get install python3-pip
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.