Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django with psycopg2 plugin

Tags:

python

django

Ive been reading the Django Book and its great so far, unless something doesn't work properly. I have been trying for two days to install the psycogp2 plugin with no luck.

i navigate to the unzipped directory and run setup.py install and it returns "You must have postgresql dev for building a serverside extension or libpq-dev for client side."

I don't know what any of this means, and google returns results tossing a lot of terms I don't really understand.

Ive been trying to learn django for abut a week now plus linux so any help would be great. Thanks

Btw, I have installed postgresql and pgadminIII from installer pack.

I also tried sudo apt-get post.... and some stuff happens...but Im lost.

like image 410
Ismaiah Avatar asked Apr 25 '12 18:04

Ismaiah


2 Answers

I'm using pip as a part of my deployment process, so using apt-get wasn't a viable option for me.

I was able to run

sudo apt-get install libpq-dev

And remove python-psycopg2 from apt-get.

Then

pip install psycopg2

worked fine for me.

like image 128
RotaJota Avatar answered Sep 20 '22 23:09

RotaJota


Try installing using apt-get:

sudo apt-get install python-psycopg2
like image 30
BluesRockAddict Avatar answered Sep 20 '22 23:09

BluesRockAddict