Virtualenvwrapper:模块“ pkg_resources”没有属性“ iter_entry_points”

时间:2019-02-16 20:16:35

标签: python python-3.x virtualenv virtualenvwrapper

每次打开新外壳时,都会出现此错误:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/virtualenvwrapper/hook_loader.py", line 223, in <module>
    main()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/virtualenvwrapper/hook_loader.py", line 132, in main
    run_hooks(hook, options, args)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/virtualenvwrapper/hook_loader.py", line 161, in run_hooks
    hook_mgr = ExtensionManager(namespace)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/stevedore/extension.py", line 106, in __init__
    verify_requirements)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/stevedore/extension.py", line 179, in _load_plugins
    for ep in self.list_entry_points():
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/stevedore/extension.py", line 168, in list_entry_points
    eps = list(pkg_resources.iter_entry_points(self.namespace))
AttributeError: module 'pkg_resources' has no attribute 'iter_entry_points'
virtualenvwrapper.sh: There was a problem running the initialization hooks.

If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3.5 and that PATH is
set properly.

奇怪的是,virtualenvwrapper仍然可以正常工作。如果我尝试激活virtualenv,它将再次吐出此错误,但是环境确实加载了。这是在我最近尝试在Mac上清理Python版本之后,但是我显然弄乱了一些路径。

让我知道是否需要更多信息。

0 个答案:

没有答案