Psycopg2: Install 2.6.1 failed

Created on 21 Sep 2017  ·  11Comments  ·  Source: psycopg/psycopg2

pip install psycopg2==2.6.1

Collecting psycopg2==2.6.1
Using cached psycopg2-2.6.1.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
Error: could not determine PostgreSQL version from '10beta4'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-_0gGZg/psycopg2/

pip install psycopg2 success and installed version 2.7.3.1
but I want version 2.6.1

Most helpful comment

All 11 comments

The problem was fixed in #489 released in psycopg 2.7. We don't have plans to backport the fix to 2.6.

Use a pg_config from a production version of Postgres not from 10 beta 4.

i get the same error with 10.1
Error: could not determine PostgreSQL version from '10.1'

OK, so I ran the command with:

sudo pip install pgadmin4-1.3-py2.py3-none-any.whl psycopg2==2.7.1

and it resolved my error:

Error: could not determine PostgreSQL version from '10.1'

@kosiara pgadmin 1.3 depends on psycopg 2.6. Install pgadmin 1.5 or following instead.

I have solved this problem.
Use PostgreSql whose version without letter.
no 'beta'

Thank you all for your help!

You can solve this by either upgrading psycopg2 or you can downgrading postgres by uninstalling postgres, installing v9.6, and adding "/Applications/Postgres.app/Contents/Versions/9.6/bin:$PATH" to your bash_profile

Yes upgrading psycopg2 helped.
Guys i had same problem in venv that was created on python 3.7.
I had psycopg2 version 2.6.2, so resolve this issue with upgrding psycopg2 to 2.7.2 and upgrading pip.

this worked for me you have to specify the version beaucause 2.6.2 of psycopg2 only supports version 9.5 of postgresql.
pip install psycopg2==2.7.7

> `pip install psycopg2==2.6.1`
> 
> > Collecting psycopg2==2.6.1
> > Using cached psycopg2-2.6.1.tar.gz
> > Complete output from command python setup.py egg_info:
> > running egg_info
> > creating pip-egg-info/psycopg2.egg-info
> > writing pip-egg-info/psycopg2.egg-info/PKG-INFO
> > writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
> > writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
> > writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
> > Error: could not determine PostgreSQL version from '10beta4'
> > ----------------------------------------
> > Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-_0gGZg/psycopg2/
> 
> `pip install psycopg2` success and installed version 2.7.3.1
> but I want version 2.6.1

PostgreSQL with version number without beta seems to be succeed.

Was this page helpful?
0 / 5 - 0 ratings