Python 错误:没有名为 pkg_resources 的模块

2023-12-26

我想在 MacOS 上使用 Python3.7

我已经是Python 2.7版本了。

我创建了一个别名.bash_profile, alias python="/usr/local/bin/python3.7" then source ~/.bash_profile.

所以我删除了Python2.7/usr/local/lib/

现在,当我尝试执行时pip install PySide2,我有一个错误:

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 6, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources

我认为这个错误是在我删除Python2.7后发生的

有人可以帮助我解决我的错误吗?

谢谢 !


pyinstaller 3.6 与 python 3.7.* 上的 setuptools 45.1.0 不兼容,应降级到 45.0.0

pip install setuptools==45.0.0

也可以通过将 hide_imports 'pkg_resources.py2_warn' 传递/添加到 pyinstaller 规范来修复

此处跟踪问题和解决方案:https://github.com/pypa/setuptools/issues/1963 https://github.com/pypa/setuptools/issues/1963

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Python 错误:没有名为 pkg_resources 的模块 的相关文章

随机推荐