[Answered ]-Error importing psycopg2._psycopg when using uWSGI

1👍

I solved this by avoiding sudo apt-get install uwsgi to install uwsgi and the uwsgi-plugin-python3. This resulted in versions built for Python 3.4 (which is also on my system).

Instead, I installed with sudo pip3 install uwsgi, with the pip3 being the one from my Python 3.5 directory. This built uwsgi and its plugins for Python 3.5. I just had to symlink the resulting uwsgi file to /usr/bin (ln -s <my python 3.5 dir>/bin/uwsgi /usr/bin/uwsgi), so that it was available system-wide.

psycopg2 seems to work fine with Python 3.5 for me, so my only problem was that uwsgi needed to be built using Python 3.5.

👤Def_Os

1👍

psycopg2 doesn’t work with python 3.5

From the features list

Supports Python versions from 2.5 to 3.4 (Python 2.4 is supported until Psycopg versions 2.4.x).

You’ll need to downgrade to python 3.4 if you wish to use this package

👤Sayse

Leave a comment