Install psycopg2 for python 3 via pip3

Install and Update Pip3:

sudo apt install python3-pip

sudo pip3 install --upgrade pip

sudo pip3 install --upgrade setuptools

Now launch the installation command for psycopg2:

sudo pip3 install psycopg2

If it returns the following error:

Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-16pukcwj/psycopg2/

Launch this other command:

sudo apt-get build-dep python3-psycopg2

And then try again with:

sudo pip3 install psycopg2

1 Comment

Leave a Comment

Your email address will not be published. Required fields are marked *