【问题标题】:Pipenv installationError: Command "python setup.py egg_info" failed with error code 1 inPipenv 安装错误:命令“python setup.py egg_info”失败,错误代码为 1
【发布时间】:2018-12-14 13:15:39
【问题描述】:

我最近开始使用 pipenv 并且在尝试安装软件包时时不时地收到以下错误:

$ pipenv lock --clear --verbose

pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in

$ pipenv install social-auth-core

 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页面没有帮助,谢谢

【问题讨论】:

  • 你激活你的环境了吗?
  • 是的,我有@Walucas

标签: python django installation pipenv


【解决方案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)

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

【讨论】:

  • 谢谢 Pi,我现在得到:from pkg_resources import Requirement ImportError: cannot import name 'Requirement'
  • 这行得通,我搞砸了我的 ve。所以运行上面的命令,然后重新创建我的 ve。谢谢你,派!
  • 第一次没有工作,直到我杀死了我的 ssh 并重新进入。然后它神奇地工作了。什么啊?反正。谢谢你!
  • @user6273920:如果升级更改了有效路径,这可能是因为“pip”的路径缓存条目过时。如果您使用的是 bash,则可以使用“hash -r”显式刷新缓存。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-12-18
  • 2017-02-20
  • 2014-02-26
  • 2018-08-08
相关资源
最近更新 更多