提问者:小点点

Heroku push:无效命令错误'egg_info'


每次我尝试部署到Heroku我得到一个错误,看起来像从这个问题(Pythonpip安装失败:无效的命令egg_info)我如何解决这个问题?它刚开始作为一个恼人的事情,会消失在第二次推送,但现在我不能推。

注意:我已经尝试过放入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

共1个答案

匿名用户

我最近经历了这个错误,尽管这个问题已经有4年零4个月的历史了,但它是SO上唯一一个关于这个问题的问题。

在我的例子中,测试突然停止运行,所以我检查了错误日志:

-----> 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

现在一切都好。希望这能帮助某人。