Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django-zappa: Error loading psycopg2 module: libpq.so.5: cannot open shared object file: No such file or directory

When trying to deploy a Django project using django-zappa, I get the following error in the zappa tail output:

django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: libpq.so.5: cannot open shared object file: No such file or directory

I've made sure to include the psycopg2 module in the requirements file:

psycopg2==2.8.3

It's installed in the virtual environment that's active while running the zappa deploy command.

I'm running on Linux and had to install libpq-dev via apt before even being able to pip install psycopg2 as I received an error before, saying that libpq was missing on the system (similar to the above error, I guess).

How can I overcome this error?

Thanks!

like image 255
OhMad Avatar asked Jun 28 '19 09:06

OhMad


1 Answers

I managed to solve the problem by installing the psycopg2-binary package:

pip install psycopg2-binary

After a redeploy, it works fine.

like image 200
OhMad Avatar answered Oct 30 '22 12:10

OhMad