【问题标题】:Push rejected to herokuapp推送到herokuapp被拒绝
【发布时间】:2018-06-19 10:35:57
【问题描述】:

我正在尝试在 heroku 上托管我的 dango rest 应用程序。当我跑步时

git push heroku master

我收到错误日志

remote: -----> Python app detected
remote:  !     The latest version of Python 3 is python-3.6.4 (you 
are using python-3.6.3, which is unsupported).
remote:  !     We recommend upgrading by specifying the latest 
version (python-3.6.4).
remote:        Learn More: 
https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing requirements with pip
remote:        Collecting pkg-resources==0.0.0 (from -r 
/tmp/build_76cc8692e5f28e80c394427df6e4d58b/requirements.txt (line 
9))
remote:          Could not find a version that satisfies the 
requirement pkg-resources==0.0.0 (from -r / 
tmp/build_76cc8692e5f28e80c394427df6e4d58b/requirements.txt (line 9)) 
(from versions: )
remote:        No matching distribution found for pkg-
resources==0.0.0 (from -r 
/tmp/build_76cc8692e5f28e80c394427df6e4d58b/requirements.txt (line 
9))
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to myapp.
remote: 
To https://git.heroku.com/myapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 
'https://git.heroku.com/myapp.git'

requirements.txt 文件是

dj-database-url==0.4.2
Django==1.11.2
django-rest-auth==0.9.2
djangorestframework==3.6.4
djangorestframework-jwt==1.11.0
gunicorn==19.7.1
olefile==0.44
Pillow==4.2.0
psycopg2==2.7.3
PyJWT==1.5.3
pytz==2017.2
six==1.11.0
whitenoise==3.3.1

push 被 heroku 拒绝。请帮忙。

【问题讨论】:

  • 它清楚地显示找不到满足pkg-resources==0.0.0要求的版本,那么问题出在哪里?从文本文件中删除该包名称并再次检查
  • 你必须在你的 runtime.txt 中指定正确的版本。
  • @CodeWizard 我添加了 requirements.txt。 ps检查
  • @Exprator 从哪里删除那个包?请正确阅读日志。

标签: django git heroku


【解决方案1】:

您本地的requirements.txt 是否与来自master 分支的requirements.txt 匹配?

我遇到了同样的问题,最后我意识到我的主分支在 requirements.txt 中有 pkg-resources 行,而我的本地副本没有。我从 requirements.txt 删除了那行,git commitgit push 删除了那行,下次我尝试将我的应用推送到 heroku 时,我成功了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-01-09
    • 2021-09-22
    • 1970-01-01
    • 2023-03-16
    • 2021-05-06
    • 2017-03-01
    • 2011-12-24
    相关资源
    最近更新 更多