Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django error for psycopg2 ImportError: DLL load failed

Hi I am getting this error while I am trying to run syncdb in my virtual environment.

If I copy psycopg2 folder to my project folder (where I have my manage.py and settings.py) then this error disappears. But I still get this error when the code is pushed to heroku.

I have referred to many online materials but wasn't very lucky.

File "c:\Users\mayayadav\anteus\venv\lib\site-packages\psycopg2-2.4.5-py2.7-wi
  n32.egg\psycopg2\__init__.py", line 67, in <module>
    from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: DLL load failed: The specified module could not be found. (venv)
like image 912
Mayank Avatar asked Oct 07 '12 03:10

Mayank


2 Answers

I had the same problem on Windows, The way i get it working was to install psycopg2 from:

http://www.stickpeople.com/projects/python/win-psycopg/

And doing it this way it's recomended here http://initd.org/psycopg/install/

like image 115
alex Avatar answered Sep 20 '22 01:09

alex


In the case, where the install binaries are not up to date (as it happened today: latest Python is 3.4 and PostgresSQL - 9.3, while latest avaiable are 3.3 and 9.2.6 respectively), it is enough to add the PostgresSQL binary path (e.g. C:\Program Files\PostgreSQL\9.3\bin) to the path variable.

Note: you need to restart your command line to get it working.

like image 24
Juliusz Avatar answered Sep 20 '22 01:09

Juliusz