0

Django is unable to detect psycopg2. I am able to import psycopg2 on python terminal.

Can you please help me as to how to proceed now? I'm using OSX 10.10.

dario
  • 5,149
  • 12
  • 28
  • 32
  • Any logs to be analysed ? – Laurent Meyer Jul 08 '15 at 10:05
  • are you using virtualenv? – Ajay Gupta Jul 08 '15 at 10:06
  • @AjayGupta, no. im using postgresql db with django but while running "python manage.py migrate" , its failing with the error "ImproperlyConfigured("Error loading psycopg2 module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module" But I am able to use psycopg2 in my standalone python scripts. – Koding Koding Jul 08 '15 at 10:09
  • are you using multiple python versions? – Ajay Gupta Jul 08 '15 at 10:13
  • @AjayGupta no. python 2.7.10 – Koding Koding Jul 08 '15 at 10:15
  • When i'm doing 'import psycopg2' in terminal, im getting ' Traceback (most recent call last): File "", line 1, in File "psycopg2/__init__.py", line 50, in from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID ImportError: dlopen(psycopg2/_psycopg.so, 2): Symbol not found: __cg_jpeg_resync_to_restart Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib Expected in: /Library/PostgreSQL/9.4/lib/libJPEG.dylib in /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib ' – Koding Koding Jul 08 '15 at 10:23
  • I had the same problem yesterday. It had to do with a failed psycopg2 update that I absent-mindedly attempted to upgrade with pip. On Windows 7, I fixed it by manually reinstalling and adding it's location to the virtual environment's sys.path. Good luck! EDIT: see an example here- http://stackoverflow.com/questions/3726705/django-what-is-sys-path-supposed-to-be – Adam Starrh Jul 08 '15 at 10:34
  • Found a more helpful question- this is the one that helped me: http://stackoverflow.com/questions/1383126/django-python-beginner-error-when-executing-python-manage-py-syncdb-psycopg2 – Adam Starrh Jul 08 '15 at 10:48

0 Answers0