heroku 无法找到满足要求pkg-resources==0.0.0的版本

ilmyapht  于 2022-11-13  发布在  其他
关注(0)|答案(5)|浏览(144)

我的应用程序部署在heroku上。
当我通过git push heroku master推送我的代码时。它给我这个错误

Collecting pkg-resources==0.0.0 (from -r requirements.txt (line 14))
remote:          Could not find a version that satisfies the requirement pkg-resources==0.0.0 (from -r requirements.txt (line 14)) (from versions: )
remote:        No matching distribution found for pkg-resources==0.0.0 (from -r requirements.txt (line 14))
remote:  !     Push rejected, failed to compile Python app.

requirement.txt

amqp==2.1.1
billiard==3.5.0.2
boto==2.42.0
celery==4.0.0
dj-database-url==0.4.1
Django==1.10.2
django-appconf==1.0.2
django-model-utils==2.6
django-storages==1.5.1
djangorestframework==3.4.7
gunicorn==19.6.0
Jinja2==2.8
kombu==4.0.0
MarkupSafe==0.23
optional-django==0.1.0
pep8==1.7.0
pkg-resources==0.0.0
psycopg2==2.6.2
pyflakes==1.3.0
pytz==2016.7
rcssmin==1.0.6
requests==2.12.1
rjsmin==1.0.12
vine==1.1.3
whitenoise==3.2.2

注意:它在我的本地服务器上运行得非常好。

我的问题是为什么不是在heroku上工作而是在local上工作???

ds97pgxw

ds97pgxw1#

requirements.txt 中删除以下行。
pkg-resources==0.0.0

byqmnocz

byqmnocz2#

为了避免每次执行冻结时都将其保存在requirements.txt中,请使用pip uninstall pkg-resources==0.0.0将其从虚拟环境中删除

mqxuamgl

mqxuamgl3#

从requirements.txt中删除pkg-resources==0.0.0
如果您希望在下次执行冻结时避免该问题,请使用pip uninstall pkg-resources==0.0.0

wtzytmuj

wtzytmuj4#

cat requirements.txt | grep --invert-match pkg-resources | xargs -n 1 pip install
请参阅以下链接以了解更详细的内容:https://code-specialist.com/python/pkg-resources

avkwfej4

avkwfej45#

Heroku CLI似乎正在使用来自其他本地分支的依赖项。如果您正在运行:

$ git push origin master

要在Heroku上部署应用程序,请确保在本地切换到主分支。

相关问题