Pipenv安装错误:命令";python setup.py egg“u info”;在中失败,错误代码为1

Pipenv安装错误:命令";python setup.py egg“u info”;在中失败,错误代码为1,python,django,installation,pipenv,Python,Django,Installation,Pipenv,我最近开始使用pipenv,在尝试安装软件包时,偶尔会出现以下错误: $pipenv锁--清除--详细 pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in line 704, in from_line line, extras = _strip_extras(line) TypeError: 'm

我最近开始使用pipenv,在尝试安装软件包时,偶尔会出现以下错误:

$pipenv锁--清除--详细

pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in
 line 704, in from_line
line, extras = _strip_extras(line)
TypeError: 'module' object is not callable
$pipenv安装社交身份验证核心

pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in
 line 704, in from_line
line, extras = _strip_extras(line)
TypeError: 'module' object is not callable
$python setup.py egg\u 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页面对错误没有帮助,谢谢你

我认为这些可能是最新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)

注意:这应该在您的虚拟环境之外运行,而不是在它激活时运行。

您激活了您的环境吗?是的,我有@WalucasThank you Pi,我现在得到:来自pkg\U资源导入需求导入恐怖:无法导入名称“需求”这起作用了,我把我的ve搞砸了。因此,运行上面的命令,然后重新创建我的ve。谢谢你,皮!在1号没有工作,直到我在中杀死了我的ssh&re ssh。然后它神奇地工作了。什么废话?无论如何谢谢你@user6273920:如果升级更改了有效路径,则可能是因为“pip”的路径缓存项过时。如果您使用的是bash,那么可以使用“hash-r”显式刷新缓存。