当我尝试git推送我的应用程序时,Heroku使用了错误的requirements.txt

问题描述 投票:1回答:1

我正在尝试首次向Heroku安装django应用程序。我一直在关注教程,事情一直很好,直到git push heroku master。我在postgrequl / psycopg2中遇到错误:

Collecting psycopg2==2.6.2 (from -r /tmp/build_9a1b9401a05f6186e32ef1f993bdd183/requirements.txt (line 10))
remote:          Downloading blah...blah../bc/psycopg2-2.6.2.tar.gz (376kB)
remote:            Complete output from command python setup.py egg_info:
remote:            running egg_info
remote:            creating pip-egg-info/psycopg2.egg-info
remote:            writing pip-egg-info/psycopg2.egg-info/PKG-INFO
remote:            writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
remote:            writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
remote:            writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
remote:            Error: could not determine PostgreSQL version from '10.5'
remote:
remote:            ----------------------------------------
remote:        Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-mu5yzi1s/psycopg2/
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to django-randomizer.

我做了一些搜索,我读了其他人有问题的地方,因为他们有一个旧版本的psycopg2。所以我编辑了我的requirements.txt文件以包含psycopg2-2.7.5,这是最新的。我想再次尝试'git push heroku master',我也会遇到同样的错误。该错误引用了psycopg2-2.6.2。

我甚至删除了我的应用程序并重新启动,但是当涉及到git push时,我得到了同样的错误。在这个时候,我认为git处于某种状态,它一直试图进行已经失败的推动。我不确定。有任何想法吗?

git reflog:
5fd142e (HEAD -> deployheroku, origin/deployheroku) HEAD@{0}: pull origin deployheroku: Fast-forward
df048a9 (origin/master, origin/HEAD, master) HEAD@{1}: reset: moving to HEAD^
5fd142e (HEAD -> deployheroku, origin/deployheroku) HEAD@{2}: commit: change settings and wsgi for heroku
df048a9 (origin/master, origin/HEAD, master) HEAD@{3}: checkout: moving from master to deployheroku
df048a9 (origin/master, origin/HEAD, master) HEAD@{4}: commit: restore local version
873d636 HEAD@{5}: commit: updated psycopg2 in requirements.txt
aebfe43 HEAD@{6}: commit: get files ready for heroku
6273553 HEAD@{7}: commit: removed old files
9b2c347 HEAD@{8}: commit: update with new app name
6b4103d HEAD@{9}: clone: from https://github.com/shmish/django-randomizer.git

我的requirements.txt是:

certifi==2018.8.13
chardet==3.0.4
defusedxml==0.5.0
Django==2.0.8
django-allauth==0.36.0
django-filter==2.0.0
docopt==0.6.2
idna==2.7
oauthlib==2.1.0
psycopg2==2.7.5
python-decouple==3.1
python3-openid==3.1.0
pytz==2018.5
requests==2.19.1
requests-oauthlib==1.0.0
urllib3==1.23
whitenoise==4.0
yarg==0.1.9
django git heroku
1个回答
0
投票
$ git show master:requirements.txt | grep psycopg2
psycopg2==2.6.2

所以你已经部署了一个错误的分支。要么在deployheroku中部署requirements.txt,要么更新master

© www.soinside.com 2019 - 2024. All rights reserved.