Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8107655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:50:53+00:00 2026-06-06T00:50:53+00:00

I created a virtualenv in my django app folder, and there I installed all

  • 0

I created a virtualenv in my django app folder, and there I installed all my python dependencies. My Django project is called theme, so in the theme folder there is a venv folder that contains the python libs.
If I run python manage.py syncdb it throwsError was: No module named postgresql_psycopg2.base. Here is the traceback:

(venv)app@domain-VirtualBox:~/dj/theme$ python manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 14, in <module>
    execute_manager(settings)
  File "/home/app/dj/theme/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 459, in execute_manager
    utility.execute()
  File "/home/app/dj/theme/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/app/dj/theme/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 261, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/home/app/dj/theme/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 69, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/home/app/dj/theme/venv/local/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/app/dj/theme/venv/local/lib/python2.7/site-packages/django/core/management/commands/syncdb.py", line 8, in <module>
    from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal
  File "/home/app/dj/theme/venv/local/lib/python2.7/site-packages/django/core/management/sql.py", line 6, in <module>
    from django.db import models
  File "/home/app/dj/theme/venv/local/lib/python2.7/site-packages/django/db/__init__.py", line 40, in <module>
    backend = load_backend(connection.settings_dict['ENGINE'])
  File "/home/app/dj/theme/venv/local/lib/python2.7/site-packages/django/db/__init__.py", line 34, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "/home/app/dj/theme/venv/local/lib/python2.7/site-packages/django/db/utils.py", line 92, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/home/app/dj/theme/venv/local/lib/python2.7/site-packages/django/db/utils.py", line 51, in load_backend
    raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured: 'postgresql_psycopg2' isn't an available database backend.
Try using django.db.backends.postgresql_psycopg2 instead.
Error was: No module named postgresql_psycopg2.base

But the thing is that if I try importing psycopg2 from a python command line, it works :

(venv)app@domain-VirtualBox:~/dj/theme$ python
Python 2.7.3 (default, Apr 20 2012, 22:44:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
>>> quit()

and here is my python path:

>>> import sys
>>> print sys.path
['', '/home/app/dj/theme/venv/local/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg', '/home/app/dj/theme/venv/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg', '/home/app/dj/theme/venv/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg', '/home/app/dj/theme/venv/lib/python2.7/site-packages/pip-1.1-py2.7.egg', '/home/app/dj/theme/venv/lib/python2.7', '/home/leonsas/dj/theme/venv/lib/python2.7/plat-linux2', '/home/app/dj/theme/venv/lib/python2.7/lib-tk', '/home/app/dj/theme/venv/lib/python2.7/lib-old', '/home/app/dj/theme/venv/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/home/app/dj/theme/venv/local/lib/python2.7/site-packages', '/home/app/dj/theme/venv/lib/python2.7/site-packages']
>>> quit()

And the whereis python:

(venv)app@domain-VirtualBox:~/dj/theme$ whereis python
python: /usr/bin/python2.7 /usr/bin/python /usr/bin/python2.7-config /etc/python2.7 /etc/python /usr/lib/python2.7 /usr/bin/X11/python2.7 /usr/bin/X11/python /usr/bin/X11/python2.7-config /usr/local/lib/python2.7 /usr/include/python2.7 /usr/share/python /usr/share/man/man1/python.1.gz

I believe the problem lies there, but I’m not sure how to fix it. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:50:56+00:00Added an answer on June 6, 2026 at 12:50 am

    Try to follow the suggestion from the django.core.exceptions.ImproperlyConfigured exception:
    use 'django.db.backends.postgresql_psycopg2' instead of 'postgresql_psycopg2' in DATABASES in your settings

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a new Django 1.3 project and app that I've created. I added
lets say i created a virtualenv called venv (virtualenv venv) From reading tutorials, i
I've created a django project with virtualenv on my server. It is an Ubuntu
In my system there is Django 1.2.3 installed system wide: C:\>python -c import django;
I installed virtualenv and created a virtual environment called ENV1. Then I activated the
I understand how to create a virtualenv, activate that virtualenv, and then install django
I am on linux mint 12. I have created a virtualenv called userena .
Sometimes I get errors that I suspect are the result of my Django app
I have installed virtualenv and created a virtualenv directory for testing out the newer
Is there something similar to the Python utility virtualenv ? Basically it allows you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.