virtualenv and I need to install "psycopg2".
I have done the following:
pip install http://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.4.tar.gz#md5=24f4368e2cfdc1a2b03282ddda814160
And I have the following messages:
Downloading/unpacking http://pypi.python.org/packages/source/p/psycopg2/psycopg2 -2.4.tar.gz#md5=24f4368e2cfdc1a2b03282ddda814160 Downloading psycopg2-2.4.tar.gz (607Kb): 607Kb downloaded Running setup.py egg_info for package from http://pypi.python.org/packages/sou rce/p/psycopg2/psycopg2-2.4.tar.gz#md5=24f4368e2cfdc1a2b03282ddda814160 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". Complete output from command python setup.py egg_info: running egg_info creating pip-egg-infopsycopg2.egg-info writing pip-egg-infopsycopg2.egg-infoPKG-INFO writing top-level names to pip-egg-infopsycopg2.egg-info op_level.txt writing dependency_links to pip-egg-infopsycopg2.egg-infodependency_links.txt writing manifest file "pip-egg-infopsycopg2.egg-infoSOURCES.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 Storing complete log in C:Documents and SettingsanlopesApplication Datapipp ip.log
My question, I only need to do this to get the psycopg2 working?
python setup.py build_ext --pg-config /path/to/pg_config build ...
Note: Since a while back, there are binary wheels for Windows in PyPI, so this should no longer be an issue for Windows users. Below are solutions for Linux, Mac users, since lots of them find this post through web searches.
psycopg2-binary PyPI package instead, it has Python wheels for Linux and Mac OS.
pip install psycopg2-binary
Install the prerequsisites for building the
psycopg2 package from source:
sudo apt install libpq-dev python3-dev
You might need to install
python3.8-dev or similar for e.g. Python 3.8.
sudo apt install libpq-dev python-dev
If that"s not enough, try
sudo apt install build-essential
sudo apt install postgresql-server-dev-all
as well before installing psycopg2 again.
See Banjer"s answer
1 Really? It"s 2021
Introduction to Machine Learning with Python: A Guide for Data Scientists 1st Edition. Machine learning has become an integral part of many commercial applications and research projects, but this f...
Python Data Science Handbook: Essential Tools for Working with Data - PDF, 1st Edition For many researchers, Python is a first-class tool, primarily because of its libraries for storing, manipulati...
Mark Lutz is the global leader in Python training, author of the oldest and best-selling Python texts, and a pioneer in the Python community since 1992.
Mark Lutz is the author of the found...
Spark is one of the hottest technologies in big data analysis right now, and with good reason. If you work for, or you hope to work for, a company that has massive amounts of data to analyze, Spark of...