Не удается установить psycopg2-binary
Я пытаюсь установить psycopg2-binary (pip3 install psycopg2-binary) в виртуальное окружение моего проекта Django на Centos 7 с предустановленным Postgresql 12 и имею хорошо известную ошибку:
Error: pg_config executable not found.
pg_config is required to build psycopg2 from source. 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'.
If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.
Я пытался установить python3-devel postgresql-libs postgresql-server postgresql-devel postgresql-contrib, но все еще имею эту ошибку.
pip3 install psycopg2, pip install psycopg2 - та же проблема.
вы можете попробовать этот метод, он очень полезен
sudo apt-get install postgresql postgresql-dev python-dev