i need to install psycopg2
for openerp
installation process, but i always found that error. i\'ve already used pip
and easy_inst
On a fresh ubuntu 14.04.2 LTS on an EC2 instance, I was able to install psycopg2 after instaling the following packages:
sudo apt-get install gcc
sudo apt-get install postgres-xc-server-dev
sudo apt-get install libpq-dev
sudo apt-get install postgresql-client-common
sudo apt-get install postgresql-common
And on a fresh AMI linux (CentOS) instance:
sudo yum install postgresql-devel
sudo yum install gcc*
Hope it helps,
Erez
psycopg2 is also available on PyPI in the form of wheel packages for the most common platform (Linux, OSX, Windows): this should make you able to install a binary version of the module, not requiring the above build or runtime prerequisites.
You can use this command : pip install psycopg2-binary
Note The psycopg2-binary package is meant for beginners to start playing with Python and PostgreSQL without the need to meet the build requirements. If you are the maintainer of a publish package depending on psycopg2 you shouldn’t use ‘psycopg2-binary’ as a module dependency. For production use you are advised to use the source distribution.
May Your system is missing the Python headers. To fix this, run:
sudo apt-get install python-dev
or
sudo apt-get install python3-dev
i had this problem but was solved by running:
pip install -Iv psycopg2==2.7.7
There is a problem installing the latest version + python3.7
For me, the missing package was
libpqxx-devel.x86_64
The invocation of gcc failed, gcc couldn't compile the source. Probably the cause is
./psycopg/psycopg.h:31:22: error: libpq-fe.h: No such file or directory In file included from psycopg/psycopgmodule.c:29:
that the header libpq-fe.h
is nowhere in the search path if you have it at all.