python django - no module psycopg2.extension even after installing compiled version psycopg2-2.4.5.win32-py2.7.‌exe python django - no module psycopg2.extension even after installing compiled version psycopg2-2.4.5.win32-py2.7.‌exe heroku heroku

python django - no module psycopg2.extension even after installing compiled version psycopg2-2.4.5.win32-py2.7.‌exe


Despite some claims on the Internet, psycopg2 DOES work in a VirtualEnv.

Download the correct version of win-psycopg2. Typically I use 32-bit Python 2.7 so I got psycopg2-2.4.5.win32-py2.7-pg9.1.3-release.exe.

You CANNOT install this file into a VirtualEnv, but you can rename the .exe file to .zip and open with a utility like 7-Zip. You will get a folder called “psycopg2″ and a file called “psycopg2-2.4.5-py2.7.egg-info”. Copy these into:

[...]\Envs\MyVirtualEnv\Lib\site-packages

This worked for me, hope it works for you.


Binaries from this link:http://www.stickpeople.com/projects/python/win-psycopg/

In settings.py it should look like this in db settings

    'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.


Take a look at http://slacy.com/blog/2010/09/python-unable-to-find-vcvarsall-bat/. It seems you need to install Microsoft Visual Studio Express to solve the vcvarsall.bat issue.Pretty crazy...