Doug Smith
Doug Smith

Reputation: 580

Heroku is using the wrong requirements.txt when I try to git push my app

I'm trying to install a django app to Heroku for the first time. I've been following tutorials and things were going fine until git push heroku master. I get an error with 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.

I did some searches and I read where other people had problems because they had an older version of psycopg2. So I edited my requirements.txt file to include psycopg2-2.7.5, which is the latest. I think try `git push heroku master' again and I get the same error. The error references psycopg2-2.6.2.

I even deleted my app and started again, but when it came to the git push, I get the same error. At this time I think that git is in some state where it keeps trying to do the push that already failed. I'm not sure though. Any ideas?

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

My requirements.txt is:

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

Upvotes: 1

Views: 890

Answers (1)

phd
phd

Reputation: 94716

$ git show master:requirements.txt | grep psycopg2
psycopg2==2.6.2

So you've deployed a wrong branch. Either deploy deployheroku or update requirements.txt in master.

Upvotes: 1

Related Questions