Error: no module named psycopg2.extensions on Mac

When I try to start django, this is what I get:

    /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python manage.py runserver 8000
Error: No module named psycopg2.extensions

Process finished with exit code 1

I found other questions with similar problems, but none on the Mac, and none of them help. I have no other errors and I installed psycopg2. Im working in PyCharm. This is my settings file (or at least its top).

ADMINS = (
    # ('Your Name', 'your_email@example.com'),
)

MANAGERS = ADMINS

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': '---',                      # Or path to database file if using sqlite3.
        'USER': '---',                      # Not used with sqlite3.
        'PASSWORD': '---',                  # Not used with sqlite3.
        'HOST': 'www.-----.com',                      # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
    }
}
+5
source share
1 answer

As you can see in the source code , Django actively uses the psycopg2.extensions module. In addition, the expansion module is physically contained in psycopg2. So, I think you installed psycopg incorrectly.

: http://initd.org/psycopg/install/

virtualenv

+4

All Articles