4

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!

OhMad
  • 4,407
  • 11
  • 39
  • 66

1 Answers1

13

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

pip install psycopg2-binary

After a redeploy, it works fine.

OhMad
  • 4,407
  • 11
  • 39
  • 66