【问题标题】:pip3 install -r requirements.txt - Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-a0nd7us1/post/pip3 install -r requirements.txt - 命令“python setup.py egg_info”失败,错误代码 1 在 /private/tmp/pip-build-a0nd7us1/post/
【发布时间】:2017-05-29 18:17:47
【问题描述】:

当我尝试pip3 install -r requirements.txt 时出现错误:

Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-a0nd7us1/post/

在我看来,我已经尝试了一切。有什么建议么?我在 virtualenv 中有 Python 3.6.1。

这是我的requirements.txt 文件:

appdirs==1.4.3
asn1crypto==0.22.0
base==1.0.4
cffi==1.10.0
cryptography==1.8.1
Django==1.11
django-cors-headers==2.0.2
djangorestframework==3.6.2
get==0.0.0
idna==2.5
inflection==0.3.1
Keras==2.0.4
modules==1.0.0
more-itertools==3.0.0
mysqlclient==1.3.10
ndg-httpsclient==0.4.2
numpy==1.12.1
packaging==16.8
pandas==0.19.2
post==0.0.0
props==0.0.2
protobuf==3.2.0
public==0.0.0
pyasn1==0.2.3
pycparser==2.17
pyOpenSSL==17.0.0
pyparsing==2.2.0
python-dateutil==2.6.0
pytz==2017.2
PyYAML==3.12
Quandl==3.1.0
query-string==0.0.0
request==0.0.0
requests==2.13.0
scipy==0.19.0
setupfiles==0.0.0
simplejson==3.10.0
six==1.10.0
tensorflow==1.1.0
Theano==0.9.0
virtualenv==15.1.0
Werkzeug==0.12.1

已解决:我只留下了必要的依赖项,一切正常。

【问题讨论】:

  • requirements.txt 文件中有什么内容?你能把它放在任务中吗?
  • 我收到It looks like your post is mostly code; please add some more details.,如何避免这种情况?
  • 哈哈哈太棒了......当然......尝试用项目符号写你一步一步尝试的所有内容,在简历中,而不是所有内容,然后添加requiremets.txt。如果不能,请添加指向选择或其他内容的链接
  • 好吧,我已经更新了我的帖子。
  • 是的,但我不确定是否所有都是必要的。也许有任何解决方案来检查不需要的内容。但我想到的唯一想法是删除所有 42 行,在python manage.py runserver 期间检查终端中的错误并安装所有需要的依赖项。这是一个很好的解决方案吗?也许会有所帮助。

标签: python python-3.x pip virtualenv


【解决方案1】:

创建 venv 后,尝试:

(yourVEnv)$ curl https://bootstrap.pypa.io/get-pip.py |蟒蛇

然后停用然后重新激活您的虚拟环境。这样做,否则 pip 将无法正常工作。

(yourVEnv)$ deactivate
$ source myvenv/bin/activate
(yourVEnv)$ which pip

或检查它

(yourVEnv)$pip -V

那你呢

pip install -r /path/to/requirements.txt

不要忘记将完整路径添加到您的 requirements.txt 中

【讨论】:

    【解决方案2】:

    由于分发已合并回 setuptools,现在建议安装/升级 setuptools:

    [sudo] pip install --upgrade setuptools
    

    【讨论】:

      猜你喜欢
      • 2018-11-03
      • 2019-08-10
      • 2017-12-13
      • 2021-10-23
      • 2016-02-14
      • 1970-01-01
      • 2018-07-13
      • 2018-11-12
      • 2019-08-21
      相关资源
      最近更新 更多