1

I'd like to deploy to Heroku. But the error messages are displayed.

$ git push heroku master

This generates the following error output:

remote:            Error: could not determine PostgreSQL version from '10.3'
remote:            
remote:            ----------------------------------------
remote:        Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-7sfvmk3a/psycopg2/
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to ayblog.
remote: 
To https://git.heroku.com/ayblog.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/ayblog.git'

I think "Error: could not determine PostgreSQL version from '10.3'" is wrong.

And I thing "Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-7sfvmk3a/psycopg2/" is also wrong.

How to do that?

Chris
  • 93,263
  • 50
  • 204
  • 189
Y A
  • 11
  • 2
  • Do you have installed `pip install psycopg2`? Also is there a record for `psycopg2` library in your `requirements.txt` file? – Panos Angelopoulos May 09 '18 at 11:43
  • Thank you so much replying. I installed psycopg2 in requirements.txt. I'd like to know how to specify a psycopg2 version. – Y A May 09 '18 at 13:19

1 Answers1

0

I did a quick google search and found that a blog post exists suggesting you do two things (copied verbatim):

Change the requirements for psycopg2 to be equal or greater than 2.6.1

Unpin psycopg2

Source: https://oshanebailey.jamaicandevelopers.com/python/error-could-not-determine-postgresql-version-10-0/

Community
  • 1
  • 1
jimf
  • 3,197
  • 1
  • 14
  • 21
  • I couldn't installed `psycopg2 2.6.1`. Because I couldn't specify its version. `pip install psycopg2==2.6.1` generates the following error output. `Error: pg_config executable not found. Please add the directory containing pg_config to the PATH or specify the full executable path with the option: python setup.py build_ext --pg-config /path/to/pg_config build ... or with the pg_config option in 'setup.cfg'. ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-install-x8n9bxw4/psycopg2/ ` – Y A May 09 '18 at 13:57
  • if you install psycopg2 in your requirements.txt without specifying, shouldn't it install the latest stable version anyway? – Hiroyuki Nuri May 09 '18 at 14:02
  • Maybe you don't have postgresql installed properly if the binaries cannot be found? You may have to install libpq (https://stackoverflow.com/questions/11618898/pg-config-executable-not-found) – jimf May 15 '18 at 05:49