Search code examples
pythonherokudistribute

Heroku warning message about setuptools/distribute in requirements.txt


Pushing a python app to Heroku, I'm getting this:

!     The package setuptools/distribute is listed in requirements.txt.
!     Please remove to ensure expected behavior.

The docs explicitly include distribute in their requirements.txt files, and when I remove it, I get this (which sure seems to depend on distribute):

Traceback (most recent call last):
  File "/app/.heroku/python/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources

 !     Push rejected, failed to compile Python app

Solution

  • This question is crazy old, but for anyone who stumbles upon this and still needs an answer, you should try upgrading your Heroku buildpack (the collection of scripts that build your app on the dynos). This will update pip (among other things), since you can't exactly do what Mauro suggested because the code is being deployed to Heroku dynos.

    More info on buildpacks: https://devcenter.heroku.com/articles/buildpacks

    But if you don't want to read the article, just do

    $ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-python

    Then re-attempt to deploy your app like normal.