django.core.exceptions.ImproperlyConfigured: Error loading psycopg module: No module named psycopg
Presently, I'm attempting to configure Django for use on a project, and am encountering a persistent error when I try to run
python manage.py syncdb.
File "/x/x/x/x/x/x/base.py", line 23, in ? raise ImproperlyConfigured("Error loading psycopg module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading psycopg module: No module named psycopg
The other discussions of a similar problem that I have found both here and on other sites ended up being solved by the user downloading and installing psycopg, but unless I'm missing something critical, I've done that several times. I downloaded the tarball, unpacked it on my server, ran
python setup.py build and
python setup.py install with a --prefix directing it to my existing Python Path...I can go and navigate to the folder and see the various psycopg files, but for whatever reason, when I try to get my new project to sync up with the database, it cannot find psycopg and, as a result, won't talk to the db.
Notes: hostmonster.com account, have tried multiple release versions of psycopg2.
I had the error as well; although
psycopg2 was installed on my system using
apt-get, my virtualenv couldn't find it:
>>> import psycopg2 Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named psycopg2
It was fixed by doing a
pip install psycopg2-binary inside the virtualenv (or
pip install psycopg2 for <2.8 psycopg2 versions).
ImportError on psycopg2 when upgrading to v2.3.0 · Issue #1914 , django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2._psycopg' #1523. Closed. You try to load psycopg, not psycopg2. Make sure that ENGINE is set to django.db.backends.postgresql_psycopg2 in the settings.py of your project:
Try to use this:
sudo apt-get install python-psycopg2
psycopg2 not found by django after installing in virtualenv, django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2' Collecting static files (python3 Dismiss Join GitHub today. GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
I had this problem on a
virtualenv in Ubuntu 18.4.
I solved it by installing psycopg2 v2.7.4:
pip install psycopg2==2.7.4
No module named 'psycopg2', Installing with sudo ( sudo pip install ) causes the installed files to be owned by root, and Django (run without sudo) cannot read them. You can sudo pip django.core.exception.Module psycopg: aucun module nommé psycopg actuellement, J'essaie de configurer Django pour une utilisation sur un projet, et je rencontre une erreur persistante quand j'essaie d'exécuter python manage.py syncdb .
You try to load psycopg, not psycopg2. Make sure that ENGINE is set to django.db.backends.postgresql_psycopg2 in the settings.py of your project:
May be problem is: 32bit version of Python cannot load a 64bit version of psycopg2.
I faced strange problem:, django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2'. Collecting static files (python3 But you will need to recompile Python on CentOS and read up on cflags and ldflags because the Makefile needs to be edited. I eventually moved the DB that requires CentOS/RHE to the cloud and went back to Ubuntu Server for my Django app. IMO, modern Python on development and use on CentOS is a no go. – Tim Cook Jan 12 '15 at 11:34
I had this problem inside a python virtual environment (virtualenv), copying the library into the site-package of the environment from the system site packages solved the problem.
No module named 'psycopg2', but "python manage.py migrate" didn't work: "django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2'". Makes sense. I do however think that we should improve the documentation around this. Because even for Python 2.7 runtime you could end up with a situation where if you use psycopg2 2.6.1 you are using l-p (since it has that specific version precompiled) and if you use psycopg2 2.7.1 then you are using wheels.
No module named psycopg2 - My site, user@hostname:~/python/my-django/users$ python3 manage.py No module named 'psycopg2' During handling of the above exception, env/lib/python3.6/site-packages/django/core/management/__init__.py", line ImproperlyConfigured: Error loading psycopg2 module: No module named 'psycopg2' I want to use postgresql with django so did the following: sudo apt-get install libpq-dev python-dev sudo apt-get update workon myenv sudo pip install psycopg2 And after configuring my settings.py
python django.core.exceptions.ImproperlyConfigured: Error loading , ImproperlyConfigured: Error loading psycopg2 module: No m odule named psycopg2 Well, so I try to install psycopg2 on Windows but it only allows me to install loading psycopg2 module: %s" % e) django.core.exceptions.
Django/Python Beginner: Error when executing python manage.py , python django.core.exceptions.ImproperlyConfigured: Error loading psycopg module: No module named psycopg? >>> import psycopg2 Traceback (most