Elena Epstein
Elena Epstein

Reputation: 75

ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2'

I have a problem with migration with my Django project. I run in the command line

python3 manage.py migrate

For some reasons I got the error

ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2'

But I have checked the psycopg2 installation and it seems that it is ok

(myenv) (base) Elenas-MacBook-Air:myenv elenaorlova$ pip install 
psycopg2==2.7.5
DEPRECATION: Python 2.7 reached the end of its life on January 
1st, 2020. Please upgrade your Python as Python 2.7 is no longer 
maintained. pip 21.0 will drop support for Python 2.7 in January 
2021. More details about Python 2 support in pip, can be found at 
https://pip.pypa.io/en/latest/development/release- 
process/#python-2-support
Requirement already satisfied: psycopg2==2.7.5 in 
./lib/python2.7/site-packages (2.7.5)

Do you know what could be the reason of this problem? I already re-installed psycopg2 several times, including manual. Will be very thankful for any help!

Upvotes: 1

Views: 1421

Answers (1)

Pikhand
Pikhand

Reputation: 21

I had the same issue. Do instead:

pip install psycopg2-binary 

Upvotes: 2

Related Questions