I
I
Irina Pakhomova2016-02-25 22:10:08
PostgreSQL
Irina Pakhomova, 2016-02-25 22:10:08

How to install psycopg2 in virtual environment on ubuntu?

Unable to install psycopg2 to work with Postgresql in Django. There is a virtual environment with python 3.4, pip install psycopg2 gives You need to install postgresql-server-dev-XY for building server-side extension or libpq-dev for building a client-side application.
I tried, as recommended, to enter sudo apt-get install libpq-dev, it seems to help, but this thing is not installed for me, it finds a bunch of unmet dependencies, and writes that it is impossible to fix, you supposedly have broken packages. I try to install them manually, he again finds some dependencies unsatisfied, ad infinitum.
I have not seen anything about postgresql-server-dev anywhere, but the sudo apt-get install postgres-server-dev-XY command does not work.
I recently work in ubuntu, a beginner, before that I sat under Windows for a million years, my brains are already on one side :) ubuntu, by the way, 14.04.3

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2016-02-25
@DemiKam

sudo apt-get update
install PostgreSQL dependencies (for it to work with Django)
sudo apt-get install libpq-dev python-dev
install PostgreSQL:
sudo apt-get install postgresql postgresql-contrib
next for Django:
pip install psycopg2 (from project folder)
and in addition to reading the article :-)
==>> blog.djangofan.ru/2015/05/postgresql-ubuntu-1404.html

I
Ivan Tuzhilkin, 2016-02-26
@Ivan_Tuzhilkin

Maybe you can find the answer here: How to install Django + Postgres + Nginx + Gunicor...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question