7

Every time I try to deploy to Heroku I get an error that looks like from this question (Python pip install fails: invalid command egg_info) How do I resolve this issue? It just started as an annoying thing that would go away on the second push, but now I can't push at all.

My requirements.txt file. NOTE: I already tried experimenting with putting in 'setuptools' and leaving it out and it didn't change anything.

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
Community
  • 1
  • 1
fangsterr
  • 3,670
  • 4
  • 37
  • 54

1 Answers1

6

I've recently experienced this error and, even though the question is 4 years, 4 months old, it's the only one here on SO regarding this issue.

In my case, tests stopped running out of the blue, so I checked the error log :

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

What appears to be only an information/deprecation message at the beginning of the log file was actually my solution : in the runtime.txt file I changed the python version to 2.7.14.

All is well now. Hope this helps someone.

AdelaN
  • 3,366
  • 2
  • 25
  • 45
  • Thanks! I had to change it back to 2.7.13 to force it to reinstall everything again – frmdstryr Apr 05 '18 at 16:13
  • Had a similar issue - forced Heroku runtime down one to `python-3.6.3`, and everything installed fine. Bumping it back to `python-3.6.4` again forced a reinstall of all dependencies, this time succeeding to build. For reference, the package that upset Heroku so was `googlemaps (2.5.1)`. – Harry Vane Apr 11 '18 at 22:07
  • Thanks, I was suddenly getting this error with tornado dependency after months of working properly, and the runtime thing fixed it. to make it clearer for those who don't know: create a file called `runtime.txt` in your main folder (where requirements.txt is) and write one line like `python-3.6.5` in it. As of May 2018, tornado says that latest version of python3 is 3.6.5 . My heroku had been on 3.6.4 all thi time. Funny though, on my local system its 3.6.5 only. – Nikhil VJ May 09 '18 at 07:12