Django with psycopg2 plugin

I read the book of Django and its great so far, if something does not work properly. I have been trying for two days to install the psycogp2 plugin with no luck.

i go to the unzipped directory and run setup.py install and it will return. "You must have postgresql dev to create a server extension or libpq-dev for the client side."

I don’t know what this means, and google returns results that throw a lot of terms that I really don’t understand.

I am trying to learn django for a later week plus linux, so any help would be great. Thanks

Btw, I installed postgresql and pgadminIII from the installation package.

I also tried sudo apt-get post .... and some things happen ... but Im lost.

+6
source share
4 answers

I use pip as part of my deployment process, so using apt-get was not a viable option for me.

I managed to run

sudo apt-get install libpq-dev 

And remove python-psycopg2 from apt-get.

Then

 pip install psycopg2 

worked great for me.

+13
source

Try installing with apt-get:

 sudo apt-get install python-psycopg2 
+4
source

I am working on Xubuntu (12.04), and I encountered the same error when I wanted to install django-toolbelt . I solved this error with the following operations:

  • sudo apt-get install python-dev
  • sudo apt-get install libpq-dev
  • sudo apt-get install python-psycopg2

I hope this information can be helpful to someone else.

+3
source

sudo apt-get install python-psycopg2 should work fine, as it worked for me as well.

-1
source

Source: https://habr.com/ru/post/914159/


All Articles