我最近已经转移到使用pipenv,每次尝试安装软件包时都会收到以下错误消息:
$ pipenv lock --clear --verbose
pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in
$ pipenv安装社交认证核心
line 704, in from_line
line, extras = _strip_extras(line)
TypeError: 'module' object is not callable
$ python setup.py egg_info
(k, v) for k, v in attrs.items()
File "/home/user/.local/share/virtualenvs/django-app-VE-name/lib/python3.6/site-packages/setuptools/dist.py", line 367, in __init__
for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
AttributeError: module 'pkg_resources' has no attribute 'iter_entry_points'
错误的github页面没有帮助,谢谢
答案 0 :(得分:1)
我认为这些可能是最新的pipenv中已修复的错误。您是否正在使用最新版本的pipenv(以及pip,setuptools和wheel)?
假设您使用的是--user
安装,则可以使用以下命令进行升级和/或检查:
$ pip install --user --upgrade --upgrade-strategy eager pipenv wheel
Requirement already up-to-date: pipenv in ./.local/lib/python3.6/site-packages (2018.11.26)
Requirement already up-to-date: wheel in ./.local/lib/python3.6/site-packages (0.32.3)
Requirement already up-to-date: setuptools>=36.2.1 in ./.local/lib/python3.6/site-packages (from pipenv) (40.6.3)
Requirement already up-to-date: virtualenv in ./.local/lib/python3.6/site-packages (from pipenv) (16.1.0)
Requirement already up-to-date: virtualenv-clone>=0.2.5 in ./.local/lib/python3.6/site-packages (from pipenv) (0.4.0)
Requirement already up-to-date: pip>=9.0.1 in ./.local/lib/python3.6/site-packages (from pipenv) (18.1)
Requirement already up-to-date: certifi in ./.local/lib/python3.6/site-packages (from pipenv) (2018.11.29)
注意:该操作应在虚拟环境的外部中运行,而不是在激活时运行。