This question already has answers here:
Can't install psycopg2-binary on macOS Monterey 12.3
(2 answers)
Closed 11 months ago.
i am trying to install psycopg2-binary module on my Mac OS. install is failing with below error message.
Any help to resolve this error?
pip install psycopg2-binary
Defaulting to user installation because normal site-packages is not writeable
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
running egg_info
creating /private/var/folders/1s/xllnfc3n1j988pnws9g93tfm77pffn/T/pip-pip-egg-info-7b1acytt/psycopg2_binary.egg-info
writing /private/var/folders/1s/xllnfc3n1j988pnws9g93tfm77pffn/T/pip-pip-egg-info-7b1acytt/psycopg2_binary.egg-info/PKG-INFO
writing dependency_links to /private/var/folders/1s/xllnfc3n1j988pnws9g93tfm77pffn/T/pip-pip-egg-info-7b1acytt/psycopg2_binary.egg-info/dependency_links.txt
writing top-level names to /private/var/folders/1s/xllnfc3n1j988pnws9g93tfm77pffn/T/pip-pip-egg-info-7b1acytt/psycopg2_binary.egg-info/top_level.txt
writing manifest file '/private/var/folders/1s/xllnfc3n1j988pnws9g93tfm77pffn/T/pip-pip-egg-info-7b1acytt/psycopg2_binary.egg-info/SOURCES.txt'
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.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
Thanks
SR
I think the issue may be related to your question, and it seems that a is also provided there. https://github.com/psycopg/psycopg2/issues/1286
You may also try to build psycopg2 from source following the instruction. https://www.psycopg.org/docs/install.html#prerequisites
Related
I'm trying to deploy a Django web app on Vercel, but the deployment fails with the following message:
Error: enter code hereCommand failed: pip3.9 install --disable-pip-version-check
--target . --upgrade -r /vercel/path0/requirements.txt error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [23 lines of output]
running egg_info
creating /tmp/pip-pip-egg-info-xergdc3a/psycopg2.egg-info
writing /tmp/pip-pip-egg-info-xergdc3a/psycopg2.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-xergdc3a/psycopg2.egg-info/dependency_links.txt
writing top-level names to /tmp/pip-pip-egg-info-xergdc3a/psycopg2.egg-info/top_level.txt
writing manifest file '/tmp/pip-pip-egg-info-xergdc3a/psycopg2.egg-info/SOURCES.txt'
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.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed
Can someone help me?
I try to install the library ipympl using pip:
pip3 install ipympl
I am on a windows computer with python 3.8.
I get this Error:
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Cargo, the Rust package manager, is not installed or is not on PATH.
This package requires Rust and Cargo to compile extensions. Install it through
the system's package manager or via https://rustup.rs/
Checking for Rust toolchain....
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
I Install https://rustup.rs/
and give path but still not working I think that I do something wrong.
I try to install the python for aws glue connectivity,
so I installed pip install --upgrade jupyter boto3 aws-glue-sessions.
I'm getting errors in this particular package.
Collecting pywinpty>=1.1.0 Using cached pywinpty-2.0.5.tar.gz (23 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [6 lines of output]
Cargo, the Rust package manager, is not installed or is not on PATH.
This package requires Rust and Cargo to compile extensions. Install it through
the system's package manager or via https://rustup.rs/
Checking for Rust toolchain....
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed
Found a solution online. Installing 64 bit Python resolved my issue. Check your installation with python -V -V, it should say 64 bit.
Ive recently bought a MacBook Pro and was setting it up for some python and Django programming but I ended up having problems installing psycopg2, I've tried several things already and none of those worked for me, here left the error,
Collecting psycopg2
Using cached psycopg2-2.9.3.tar.gz (380 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
running egg_info
creating /private/var/folders/7f/ssr40bmj6t3_yq0cv_43cttc0000gn/T/pip-pip-egg-info-noe7l09b/psycopg2.egg-info
writing /private/var/folders/7f/ssr40bmj6t3_yq0cv_43cttc0000gn/T/pip-pip-egg-info-noe7l09b/psycopg2.egg-info/PKG-INFO
writing dependency_links to /private/var/folders/7f/ssr40bmj6t3_yq0cv_43cttc0000gn/T/pip-pip-egg-info-noe7l09b/psycopg2.egg-info/dependency_links.txt
writing top-level names to /private/var/folders/7f/ssr40bmj6t3_yq0cv_43cttc0000gn/T/pip-pip-egg-info-noe7l09b/psycopg2.egg-info/top_level.txt
writing manifest file '/private/var/folders/7f/ssr40bmj6t3_yq0cv_43cttc0000gn/T/pip-pip-egg-info-noe7l09b/psycopg2.egg-info/SOURCES.txt'
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.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
It shows it is not a problem with pip but with setup.py but can not find anything,
any help would be welcomed
Thanks
As Alex mentioned, it is PostGreSQL being not installed on your system that throws up the error
Install PostGreSQL and it will all work fine
Try this
❯ brew install postgresql
# If you open a new terminal tab you will see that pg_config is available
❯ export CPPFLAGS="-I/opt/homebrew/opt/openssl#1.1/include"
❯ export LDFLAGS="-L/opt/homebrew/opt/openssl#1.1/lib -L${HOME}/.pyenv/versions/3.8.10/lib"
❯ python -V
Python 3.9.13
❯ pip install psycopg2-binary==2.8.6```
Try using the following command:
pip3 install psycopg2-binary
Late, but I just had this problem and nothing I was finding was fixing it. I was trying to install the requirements.txt for an ongoing project on a new Mac. Eventually I remembered it's a postgresql package and I hadn't installed postgresql yet. As soon as I installed postgresql and tried installing psycopg2 again, it worked fine with no errors.
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.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I am a beginner so my knowledge is pretty loose on all factors above. A simplified step-by-step explanation would be much appreciated.
You can try pip install psycopg2-binary then install django-heroku again.
The error is just simply saying that your computer can't find psycopg2-binary package