简体   繁体   English

找不到满足要求的版本 pkg-resources==0.0.0

[英]Could not find a version that satisfies the requirement pkg-resources==0.0.0

My app is deployed on heroku .我的应用程序部署在heroku上。

When I push my code via git push heroku master .当我通过git push heroku master It gives me this error它给了我这个错误

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

Note : Its working perfectly fine on my local server.注意:它在我的本地服务器上工作得很好。

My Question is why is not working on heroku but working on local .我的问题是为什么不在heroku上工作,而是在local工作。 ??? ???

requirements.txt中删除以下行。

pkg-resources==0.0.0

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

Remove pkg-resources==0.0.0 from requirements.txt从 requirements.txt 中删除pkg-resources==0.0.0

if you wish to avoid the problem next time you do a freeze, use pip uninstall pkg-resources==0.0.0如果您希望下次冻结时避免该问题,请使用pip uninstall pkg-resources==0.0.0

It appears Heroku CLI is using dependencies from a different local branch. 看来Heroku CLI正在使用来自不同本地分支的依赖项。 If you are running: 如果您正在运行:

$ git push origin master

to deploy your application on Heroku, ensure that locally you are switched to master branch. 在Heroku上部署您的应用程序,确保您在本地切换到主分支。

cat requirements.txt |猫要求.txt | grep --invert-match pkg-resources | grep --invert-match pkg-resources | xargs -n 1 pip install xargs -n 1 pip 安装

refer to below link for more detailed writeup it worked for me !有关对我有用的更详细的文章,请参阅下面的链接! https://code-specialist.com/python/pkg-resources https://code-specialist.com/python/pkg-resources

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM