1

我想为 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/  

实际上,我不知道如何解决这个问题。那么,任何人都可以帮助我为什么会收到此错误?以及如何解决这个错误?

4

1 回答 1

1

这看起来像是 python setuptools 模块中的一个旧错误 - https://github.com/pypa/setuptools/issues/885

您应该更新您的 setuptools 并重试。

于 2018-06-25T11:56:55.030 回答