Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest psycopg2-binary fails to install due to "pg_config executable not found". #1290

Closed
williamblevins opened this issue Jun 16, 2021 · 10 comments

Comments

@williamblevins
Copy link

#21 6.796 Collecting psycopg2-binary (from -r benchmark/requirements.txt (line 7))
#21 7.020   Downloading https://files.pythonhosted.org/packages/39/55/54778407e306de1acd3c616dc6a04e3821effa52c21d6c688d4947878658/psycopg2-binary-2.9.tar.gz (379kB)
#21 7.376     Complete output from command python setup.py egg_info:
#21 7.377     running egg_info
#21 7.377     creating pip-egg-info/psycopg2_binary.egg-info
#21 7.377     writing pip-egg-info/psycopg2_binary.egg-info/PKG-INFO
#21 7.377     writing dependency_links to pip-egg-info/psycopg2_binary.egg-info/dependency_links.txt
#21 7.377     writing top-level names to pip-egg-info/psycopg2_binary.egg-info/top_level.txt
#21 7.377     writing manifest file 'pip-egg-info/psycopg2_binary.egg-info/SOURCES.txt'
#21 7.377     
#21 7.377     Error: pg_config executable not found.
#21 7.377     
#21 7.377     pg_config is required to build psycopg2 from source.  Please add the directory
#21 7.377     containing pg_config to the $PATH or specify the full executable path with the
#21 7.377     option:
#21 7.377     
#21 7.377         python setup.py build_ext --pg-config /path/to/pg_config build ...
#21 7.377     
#21 7.377     or with the pg_config option in 'setup.cfg'.
#21 7.377     
#21 7.377     If you prefer to avoid building psycopg2 from source, please install the PyPI
#21 7.377     'psycopg2-binary' package instead.
#21 7.377     
#21 7.377     For further information please check the 'doc/src/install.rst' file (also at
#21 7.377     <https://www.psycopg.org/docs/install.html>).
#21 7.377     
#21 7.377     
#21 7.377     ----------------------------------------
#21 7.511 Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-x52axzyq/psycopg2-binary/
@williamblevins
Copy link
Author

May be related to #1289

@dvarrazzo
Copy link
Member

What platform, python, pip version is this? Can you try running pip install -v psycopg2-binary?

@karlism
Copy link

karlism commented Jun 17, 2021

I'm experiencing same issue on CentOS 8 with module version 2.9, no issues previously by installing 2.8.6:

$ python3 --version
Python 3.6.8
$ pip3 --version
pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)

@karlism
Copy link

karlism commented Jun 17, 2021

@dvarrazzo
Copy link
Member

@karlism try upgrading pip

@karlism
Copy link

karlism commented Jun 17, 2021

@dvarrazzo, thanks, upgrading pip to version 21.1.2 has resolved the issue and psycopg2-binary version 2.9 installed successfully now.

@dvarrazzo
Copy link
Member

@karlism thank you for confirming. As documented pip should be up to date in order to install the binary packages.

Waiting for a confirmation from the OP. @williamblevins is the problem solved for you too by updating pip?

@billzichos
Copy link

billzichos commented Jun 17, 2021

I was having the same problem last night. A pip upgrade worked for me as well. My RedHat image was on pip 6.1.1 with Python 3.6.8. Thank you all!
@dvarrazzo

@williamblevins
Copy link
Author

williamblevins commented Jun 17, 2021

I'm running the latest apt version of pip for ubuntu:18.04.

https://packages.ubuntu.com/bionic/python3-pip

python3-pip (9.0.1-2.3~ubuntu1.18.04.4)

@dvarrazzo
Copy link
Member

@williamblevins you will need to update pip to use the binary packages. The need to use a recent pip version is documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants