As there is no valid way to explicitly depend on psycopg2 at this time, the error message has been made easier to understand.
(venv) @shimizukawa ➜ /tmp/proj $ python
Python 3.8.19 (default, Aug 14 2024, 05:07:38)
[Clang 18.1.8 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import django_redshift_backend.base
Traceback (most recent call last):
File "/tmp/proj/venv/lib/python3.8/site-packages/django_redshift_backend/base.py", line 24, in <module>
from psycopg2.extensions import Binary
ModuleNotFoundError: No module named 'psycopg2'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/tmp/proj/venv/lib/python3.8/site-packages/django_redshift_backend/base.py", line 26, in <module>
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module. Please install as: `pip install django-redshift-backend[psycopg2]` or `pip install django-redshift-backend[psycopg2-binary]`. For more information, see https://django-redshift-backend.readthedocs.io/en/master/basic.html#installation
Error loading psycopg2 module. Please install as:pip install django-redshift-backend[psycopg2]orpip install django-redshift-backend[psycopg2-binary]. For more information, see https://django-redshift-backend.readthedocs.io/en/master/basic.html#installation
Details #150.
As there is no valid way to explicitly depend on
psycopg2
at this time, the error message has been made easier to understand.Error loading psycopg2 module. Please install as:
pip install django-redshift-backend[psycopg2]or
pip install django-redshift-backend[psycopg2-binary]. For more information, see https://django-redshift-backend.readthedocs.io/en/master/basic.html#installation