17
votes

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 '10.4'

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-lR9u0X/psycopg2/

Does anyone know what's the issue? Trying to run pgadmin in virtualenv and can't figure out because of this error.

2
What OS are you on? You probably need to upgrade your libpq to a newer version. - gdahlm
debian 9 stretch and libpq is already on the newest version. libpq-dev is already the newest version (10.4-2.pgdg90+1). - risotto
Are you locking the version of psycopg2? Can you just use pip3 install psycopg2-binary to avoid the build? - gdahlm
no im not locking and it doesnt make any difference same problem - risotto
Ya that's it, pgadmin3/stretch-pgdg 1.22.2-4.pgdg90+1 amd64 and pgadmin4/stretch-pgdg 3.1-1.pgdg90+1 amd64 will be using an older version that doesn't work with postgres 10. you will have to install a non-package version of pgadmin. - gdahlm

2 Answers

38
votes

A higher version of psycopg2 fixed the issue for me, update your requirements.txt to:

...
psycopg2==2.7.5
...
1
votes

Solution for me:

$wget https://files.pythonhosted.org/packages/51/2f/48c3bda0b629f6e6b2c0dc57d737f2612389d2c43797209034c604349b71/redshift-sqlalchemy-0.4.tar.gz

$ tar -zxvf redshift-sqlalchemy-0.4.tar.gz

Change inside requires.txt psycopg2==2.5 to psycopg2 (2.7.6.1)

$vi redshift-sqlalchemy-0.4/redshift_sqlalchemy.egg-info/requires.txt

.......

psycopg2==2.7.6.1 <---Change Here

SQLAlchemy>=0.8.0

.................

Change inside setup.py psycopg2

$vi redshift-sqlalchemy-0.4/setup.py

CHANGE

..........

install_requires=['psycopg2==2.5', 'SQLAlchemy>=0.8.0'],

..........

TO

..........

install_requires=['psycopg2==2.7.6.1', 'SQLAlchemy>=0.8.0'],

Run the manual pip installation

$ pip install -r redshift-sqlalchemy-0.4/redshift_sqlalchemy.egg-info/requires.txt file:///home/etl/redshift-sqlalchemy-0.4/