关于setuptools的Heroku警告消息/在requirements.txt中分发

时间:2014-08-06 19:19:49

标签: python heroku distribute

将一个python应用程序推送到Heroku,我得到了这个:

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

文档明确包括在他们的requirements.txt文件中分发,当我删除它时,我得到了这个(肯定似乎取决于分发):

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

2 个答案:

答案 0 :(得分:2)

这个问题已经过时了,但是对于任何偶然发现并仍然需要答案的人来说,你应该尝试升级你的Heroku buildpack(在dynos上构建你的应用程序的脚本集合)。这将更新pip(以及其他内容),因为你无法完全按照Mauro的建议行事,因为代码被部署到Heroku dynos。

有关buildpacks的更多信息:https://devcenter.heroku.com/articles/buildpacks

但如果您不想阅读该文章,请执行

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

然后重新尝试正常部署您的应用。

答案 1 :(得分:1)

升级setuptoolsdistribute

pip install --upgrade setuptools
pip install --upgrade distribute

更新您的requirements.txt。这对我来说完全是昨天。