-2

I'm getting this error

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 390, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 440, in execute
    self.check()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py", line 478, in check
    include_deployment_checks=include_deployment_checks,
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/checks/registry.py", line 72, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/checks/model_checks.py", line 28, in check_all_models
    errors.extend(model.check(**kwargs))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py", line 1183, in check
    errors.extend(cls._check_long_column_names())
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/models/base.py", line 1588, in _check_long_column_names
    connection = connections[db]
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/utils.py", line 240, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/utils.py", line 111, in load_backend
    return import_module('%s.base' % backend_name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 24, in <module>
    raise ImproperlyConfigured("Error loading psycopg2 module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/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

Can you please tell me where I am going wrong?

BTW, my psycopg2 is working fine as a standalone module.

halfer
  • 19,824
  • 17
  • 99
  • 186
  • As a note this kind of question is not going to get much attention. Maybe take some time to give some details instead of a F* huge stacktrace. – Matt Seymour Jul 08 '15 at 08:20
  • Please share your code and configuration – Finwood Jul 08 '15 at 08:20
  • @Finwood this is the error I get when I run "python manage.py migrate" any pointer? MattWritesCode , really sorry. This is my first question. – Koding Koding Jul 08 '15 at 08:36
  • 1
    possible duplicate of [Django is unable to detect psycopg2](http://stackoverflow.com/questions/31289307/django-is-unable-to-detect-psycopg2) – Adam Starrh Jul 08 '15 at 11:59

2 Answers2

1

this statement solved everything: export DYLD_LIBRARY_PATH=''

0

You have to be more precisely with your Question. First of all, your error is :

ImproperlyConfigured: Error loading psycopg2 module

When do you get this error? (what command you run?) What is your settings.py looking like?

Also you should format your Question better, it's a pain to read this Traceback!

I know this is more a comment then an answer, but i don't had enough reputation for that.

Sativa
  • 348
  • 1
  • 2
  • 14
  • sorry for wrong formatting. this is my first question. please ignore that this time and read the log. It's kinda urgent. – Koding Koding Jul 08 '15 at 08:49
  • Well you still should start with giving us the settings.py, there is a part like this DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'name of your database', 'USER': 'name of your database user', 'PASSWORD': 'password super secret', 'HOST': 'localhost', 'PORT': '', } } – Sativa Jul 08 '15 at 08:54
  • http://pastebin.com/wg8gDQBj This is the automatic one which is created by Django. I just added extra DataBase. – Koding Koding Jul 08 '15 at 08:58
  • also, it was running fine till last night. Today I installed 'requests' and hell broke lose. Any relation b/w these? – Koding Koding Jul 08 '15 at 08:59
  • your settings.py looks okay. take a look here: http://stackoverflow.com/questions/24351055/psycopg2-installation-for-os-x-and-django and http://stackoverflow.com/questions/11538249/python-pip-install-psycopg2-install-error/12397173#12397173 – Sativa Jul 08 '15 at 09:03
  • everything is getting resolved if im using only the default database. its adding the second database thats creating the problem – Koding Koding Jul 08 '15 at 09:24