我无法导入pkg_resources。每当我想它显示ImportError:没有名为'pkg_resources.extern.six.moves'的模块; 'pkg_resources.extern.six'不是包
Python 3.5.2 (default, Jun 28 2016, 08:46:01)
[GCC 6.1.1 20160602] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pkg_resources
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.5/site-packages/pkg_resources/__init__.py", line 47, in <module>
from pkg_resources.extern.six.moves import urllib, map, filter
ImportError: No module named 'pkg_resources.extern.six.moves'; 'pkg_resources.extern.six' is not a package
是from pkg_resources
指/usr/lib/python3.5/site-packages/pkg_resources/extern
(其中不存在6包)。你能指出我做错了什么吗?
我使用Arch Linux的,Python的3.5.2
能否请您发布您的代码......我觉得可能是进口的问题。导致它对我的工作很好。 –
@RohitSalunke对不起,没有得到你。我没有任何代码。我只是不能在python3控制台中导入pkg_resources。 –
好的,在python lib中可能会有问题。尝试运行'sudo apt-get install --reinstall python-pkg-resources'。在我的例子中'import pkg_resources'工作正常。 –