Answer the question
In order to leave comments, you need to log in
How to install psycopg2?
I have been trying to solve the problem for several days - it does not work.
Error logs:
Error: pg_config executable not found.
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 dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
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/var/folders/s5/gszz_sn97_q00sn6hnp0lmxh0000gn/T/pycharm-packaging/psycopg2/
PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.5/bin/ sudo pip install psycopg2
Answer the question
In order to leave comments, you need to log in
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 ...
If the 3rd python, then
through the virtual environment
I did not notice that Mac :)
See here
initd.org/psycopg/docs/install.html
They suggest installing through Fink.
I remember that there was a similar problem, but I don’t remember how I solved it, it was a long time ago and I already have a driver installed on my Mac)
Most often it is better to install postgres locally so that
If not, then you need to put
libpq-dev
Description: header files for libpq5 (PostgreSQL library)
Header files and static library for compiling C programs to link with the libpq library in
order to communicate with a PostgreSQL database backend.
sudo apt-get install libpq-dev python3-dev
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question