Command "python setup.py egg_info" failed with error code 1 pygresql

913 views Asked by At

I'm not able to install pygresql. When I run pip install, I get this:

(postgresql) Matts-MacBook-Pro:~ mattspeck$ pip install pygresql Collecting pygresql Using cached PyGreSQL-5.0.4.tar.gz Complete output from command python setup.py egg_info: sh: pg_config: command not found Traceback (most recent call last): File "<string>", line 1, in <module> File "/private/var/folders/0q/fzk2q0_94tn_z1vlf446_jdr0000gn/T/pip-build-qOeMG3/pygresql/setup.py", line 88, in <module> pg_version = pg_version() File "/private/var/folders/0q/fzk2q0_94tn_z1vlf446_jdr0000gn/T/pip-build-qOeMG3/pygresql/setup.py", line 82, in pg_version match = re.search(r'(\d+)\.(\d+)', pg_config('version')) File "/private/var/folders/0q/fzk2q0_94tn_z1vlf446_jdr0000gn/T/pip-build-qOeMG3/pygresql/setup.py", line 74, in pg_config raise Exception("pg_config tool is not available.") Exception: pg_config tool is not available.

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/0q/fzk2q0_94tn_z1vlf446_jdr0000gn/T/pip-build-qOeMG3/pygresql/

I'm running Anaconda Python 2.7.13 on my computer.

I've tried installing both within and outside of the virtualenv. Anyone know why this is happening / if there is a fix?

1

There are 1 answers

0
Swagatika On

I ran the following command before installing pygresql. It worked.

sudo apt-get install libpq-dev python-dev