【问题标题】:Heroku push: invalid command error 'egg_info'Heroku 推送:无效命令错误“egg_info”
【发布时间】:2013-11-21 07:38:43
【问题描述】:

每次我尝试部署到 Heroku 时,都会收到类似于此问题 (Python pip install fails: invalid command egg_info) 的错误,我该如何解决此问题?它刚开始是一件烦人的事情,在第二次推动时就会消失,但现在我根本无法推动。

我的 requirements.txt 文件。注意:我已经尝试过放入“setuptools”并将其排除在外,但它并没有改变任何东西。

Django==1.5.5
dj-database-url==0.2.1
psycopg2==2.4.6
wsgiref==0.1.2
South==0.8.1
pytz==2013b
gunicorn==0.17.4
django-storages==1.1.6
django-extensions==1.1.1
boto==2.9.9
xhtml2pdf==0.0.5
django-debug-toolbar==0.10.2
numpy==1.6.2
pandas==0.11.0
django-model-utils==1.4.0
django-mailchimp-v1.3==1.3
requests==2.0.0
stripe==1.9.1
django-appconf==0.6
newrelic
redis==2.7.6
django-redis==3.3
rq==0.3.8
django-rq==0.5.1
django-loginas==0.1.3
djangorestframework==2.3.8
pusher==0.8
django-json-field==0.5.5
ZSI==2.0-rc3
APScheduler==2.1.0
django-twilio==0.4
rq-scheduler==0.3.6
django-ios-notifications==0.1.5
mixpanel-py==3.0.0

【问题讨论】:

  • 发生在我身上...希望有人能提供帮助
  • 您需要安装setuptools,正如其他问题所述。正是 那个 项目添加了egg_info 命令。
  • 它在我的 requirements.txt 中指定,所以不知道为什么会出现问题...
  • 你能把你的 requirements.txt 文件的内容贴在你的问题中吗,我会弄明白的

标签: python heroku


【解决方案1】:

我最近遇到了这个错误,尽管这个问题是 4 年 4 个月大,但它是关于这个问题的唯一一个。

就我而言,测试突然停止运行,所以我检查了错误日志:

-----> Python app detected
 !     The latest version of Python 2 is python-2.7.14 (you are using python-2.7.13, which is unsupported).
 !     We recommend upgrading by specifying the latest version (python-2.7.14).
       Learn More: https://devcenter.heroku.com/articles/python-runtimes
-----> Installing pip
-----> Installing requirements with pip
...
Collecting coverage==4.1 (from -r dev-requirements.txt (line 14))
  Downloading coverage-4.1.tar.gz (370kB)
    Complete output from command python setup.py egg_info:
    /app/.heroku/python/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'entry_points'
      warnings.warn(msg)
    /app/.heroku/python/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'zip_safe'
      warnings.warn(msg)
    usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
       or: -c --help [cmd1 cmd2 ...]
       or: -c --help-commands
       or: -c cmd --help

    error: invalid command 'egg_info'

日志文件开头的信息/弃用消息实际上是我的解决方案:runtime.txt 文件中,我将python 版本更改为2.7.14

现在一切都很好。希望这对某人有所帮助。

【讨论】:

  • 谢谢!我不得不将它改回 2.7.13 以强制它重新安装所有内容
  • 有一个类似的问题 - 强制 Heroku 运行时下降一个到python-3.6.3,并且一切都安装得很好。再次将其撞回python-3.6.4 会强制重新安装所有依赖项,这次成功构建。作为参考,惹恼 Heroku 的软件包是 googlemaps (2.5.1)
  • 谢谢,经过几个月的正常工作后,我突然收到与龙卷风依赖有关的错误,并且运行时修复了它。为了让那些不知道的人更清楚:在您的主文件夹(requirements.txt 所在的位置)中创建一个名为runtime.txt 的文件,并在其中写入一行python-3.6.5。截至 2018 年 5 月,tornado 表示最新版本的 python3 是 3.6.5 。我的 heroku 一直在 3.6.4 上。不过有趣的是,在我的本地系统上它只有 3.6.5。
猜你喜欢
  • 2015-06-20
  • 1970-01-01
  • 1970-01-01
  • 2013-09-27
  • 2019-07-03
  • 1970-01-01
  • 2014-03-14
  • 2012-07-10
  • 1970-01-01
相关资源
最近更新 更多