I'm trying to get the python postgres client module installed on Ubuntu 12.04. The guidance is to do the following:
apt-get install python-psycopg2
However, apt
says that the package can't be located.
I'm keen to install this through apt
. Is this part of another package that I can install?
This question is related to
python
postgresql
ubuntu
This worked for me:
pip install psycopg2-binary
Use
sudo apt-get install python3-psycopg2
for Python3 )
This works for me in Ubuntu 12.04 and 15.10
if pip not installed:
sudo apt-get install python-pip
and then:
sudo apt-get update
sudo apt-get install libpq-dev python-dev
sudo pip install psycopg2
I prefer using pip in case you are using virtualenv:
apt install libpython2.7 libpython2.7-dev
pip install psycopg2
I updated my requirements.txt
to have
psycopg2==2.7.4 --no-binary=psycopg2
So that it build binaries on source
Source: Stackoverflow.com