[Solved-4 Solutions] pg_config executable not found
Error Description:
- Trouble installing psycopg2. We get the following error when we try to pip install psycopg2:
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 ... click below button to copy the code. By - python tutorial - team
- or with the pg_config option in 'setup.cfg'.
- Command python setup.py egg_info failed with error code 1 in /tmp/pip-build/psycopg2
Solution 1:
- pg_config is in postgresql-devel (libpq-dev in Debian/Ubuntu, libpq-devel on Cygwin/Babun.)
Solution 2:
- On Mac OS X, we can solve it with
brew install postgresql click below button to copy the code. By - python tutorial - team
Solution 3:
- Have you installed python-dev? If you already have, try also installing libpq-dev
sudo apt-get install libpq-dev python-dev click below button to copy the code. By - python tutorial - team
Solution 4:
sudo apt-get install libpq-dev