【问题标题】:Could not find a version that satisfies the requirement pkg-resources==0.0.0找不到满足要求的版本 pkg-resources==0.0.0
【发布时间】:2017-04-01 22:07:58
【问题描述】:

我的应用部署在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 上工作。 ???

【问题讨论】:

  • 请在requirement.txt第14行注释并推送代码
  • 我明白了。但是为什么它在本地而不是在 heroku 上工作
  • 是的,它工作正常,但我想问为什么它不能在 heroku 上工作
  • 我知道它不是直接复制的,但我想它是因为您的本地版本已经安装了它,因此不需要去寻找它

标签: python django heroku pip


【解决方案1】:

requirements.txt 中删除以下行。

pkg-resources==0.0.0

【讨论】:

    【解决方案2】:

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

    【讨论】:

      【解决方案3】:

      看来 Heroku CLI 正在使用来自不同本地分支的依赖项。 如果你正在跑步:

      $ git push origin master
      

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

      【讨论】:

        猜你喜欢
        • 2020-10-28
        • 1970-01-01
        • 2023-03-20
        • 2021-12-25
        • 2018-10-13
        • 2019-07-18
        • 2020-04-15
        • 2015-11-24
        • 2013-08-16
        相关资源
        最近更新 更多