问题描述
我在Ubuntu 14上工作.我安装了python3和pip3.当我尝试使用pip3时,出现此错误
I work on Ubuntu 14. I install python3 and pip3.When I try to use pip3, I have this error
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python3.5/dist-packages/pkg_resources/__init__.py", line 70, i
n <module>
import packaging.version
ImportError: No module named 'packaging'
有人知道是什么问题吗?
Does someone know what is the issue?
非常感谢
推荐答案
如果我很了解,导致其他人答复混乱的问题是您在运行pip本身时出错,这会阻止pip的自我更新或安装缺少的包裹.
If I understand well, the issue that causes confusion in other's replies is that you have an error while running pip itself, which prevents self-updates of pip or installation of the missing package.
根据要求,请准确说明 如何安装Python 3和pip. Ubuntu 14不附带Python 3.5.
As requested, please state exactly how you installed Python 3 and pip. Ubuntu 14 does not come with Python 3.5.
为进行诊断,请提供输出
For diagnosis, please give the output of
which python3
可能是/usr/bin/python3
,并且当您的pip位于/usr/local/bin/pip3
时是指系统范围的python3.
that is probably /usr/bin/python3
and refers to the system-wide python3 while your pip is located in /usr/local/bin/pip3
.
建议的解决方案:使用apt-get remove python3-pip
卸载系统pip,然后使用pip3
或python3.5 -m pip
重试.
Suggested solution: Uninstall system pip with apt-get remove python3-pip
and try again with either pip3
or python3.5 -m pip
.
这篇关于没有名为包装的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!