我的 ubuntu 14.04 LTS 安装处于奇怪状态。我尝试同时安装 python3.5 和 python3.4 才出现这种情况。
我安装了python3.5和python3.5-dev,来自死蛇,但我收到了错误:
$ pip3.5
Traceback (most recent call last):
File "/usr/local/bin/pip3.5", line 9, in <module>
load_entry_point('pip==7.1.0', 'console_scripts', 'pip3.5')()
File "/usr/local/lib/python3.5/dist-packages/setuptools-28.2.0-py3.5.egg/pkg_resources/__init__.py", line 567, in load_entry_point
File "/usr/local/lib/python3.5/dist-packages/setuptools-28.2.0-py3.5.egg/pkg_resources/__init__.py", line 2604, in load_entry_point
File "/usr/local/lib/python3.5/dist-packages/setuptools-28.2.0-py3.5.egg/pkg_resources/__init__.py", line 2264, in load
File "/usr/local/lib/python3.5/dist-packages/setuptools-28.2.0-py3.5.egg/pkg_resources/__init__.py", line 2270, in resolve
ImportError: No module named 'pip'
到底是怎么回事?
答案1
安装 python 3.5 后,我可以按如下方式安装 pip:$sudo apt install python3-pip
完成此步骤后,当我调用 which pip3 时,我得到以下内容: $which pip3 $/usr/bin/pip3
因此,我可以按如下方式使用它:$pip3
答案2
pip
有时在设置所安装模块的读取权限时会出现问题。尝试以下操作:
sudo chmod -R a+rX /usr/local/lib/python3.5/dist-packages/