我想为python3安装simplekml。因此,我尝试使用sudo python3 -m pip install simplekml
命令安装simplekml。但是我遇到一个错误:
Collecting simplekml
Downloading https://files.pythonhosted.org/packages/a7/dd/a7628e278507d76b3708a81f60bb719af58ca0123cbee50094f7d90e560f/simplekml-1.3.0.zip (52kB)
100% |████████████████████████████████| 61kB 286kB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 11, in <module>
from setuptools.extern.six.moves import filterfalse, map
File "/usr/lib/python3/dist-packages/setuptools/extern/__init__.py", line 1, in <module>
from pkg_resources.extern import VendorImporter
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2927, in <module>
@_call_aside
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2913, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2952, in _initialize_master_working_set
add_activation_listener(lambda dist: dist.activate())
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 956, in subscribe
callback(dist)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2952, in <lambda>
add_activation_listener(lambda dist: dist.activate())
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2515, in activate
declare_namespace(pkg)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2097, in declare_namespace
_handle_ns(packageName, path_item)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2047, in _handle_ns
_rebuild_mod_path(path, packageName, module)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2066, in _rebuild_mod_path
orig_path.sort(key=position_in_sys_path)
AttributeError: '_NamespacePath' object has no attribute 'sort'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-o8a_7rsc/simplekml/
实际上,我不知道如何解决这个问题。因此,有人可以帮助我为什么我收到此错误吗?以及如何解决这个错误?
答案 0 :(得分:1)
这看起来像是python setuptools模块中的一个旧错误-https://github.com/pypa/setuptools/issues/885
您应该更新您的设置工具,然后重试。