Install psycopg2 in Linux with Python 3

It’s hard to install psycopg2 on a Linux server that running python 3.

First of all, you need to install python3-dev. The python3-dev package is required for compilation of Python 3 extensions written in C or C++, like psycopg2. If you’re running a Debian-based distribution (e.g. Ubuntu, linux mint), you can install python3-dev by running:

apt-get install python3-dev

Then you can install psycopg2 normally (here is example with a python package manager):

pip install psycopg2

If you’re using python2, you should install python-dev instead

Categories: IT | Tags: , , , | Leave a comment

Post navigation

Tinggalkan Jejakmu berupa komen

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a free website or blog at

%d bloggers like this: