使用Postgres运行Django时出现问题

时间:2012-09-07 13:57:42

标签: django postgresql-9.1

我在我的机器(Mac OS)上安装了Postgres和Django,但是当我运行Django服务器时出现此错误

50>>
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/django/core/management/commands/runserver.py", line 91, in inner_run
    self.validate(display_num_errors=True)
  File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 266, in validate
    num_errors = get_validation_errors(s, app)
  File "/Library/Python/2.7/site-packages/django/core/management/validation.py", line 23, in get_validation_errors
    from django.db import models, connection
  File "/Library/Python/2.7/site-packages/django/db/__init__.py", line 40, in <module>
    backend = load_backend(connection.settings_dict['ENGINE'])
  File "/Library/Python/2.7/site-packages/django/db/__init__.py", line 34, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "/Library/Python/2.7/site-packages/django/db/utils.py", line 92, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/Library/Python/2.7/site-packages/django/db/utils.py", line 24, in load_backend
    return import_module('.base', backend_name)
  File "/Library/Python/2.7/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/Library/Python/2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 13, in <module>
    from django.db.backends.postgresql_psycopg2.creation import DatabaseCreation
  File "/Library/Python/2.7/site-packages/django/db/backends/postgresql_psycopg2/creation.py", line 1, in <module>
    import psycopg2.extensions
  File "/Library/Python/2.7/site-packages/psycopg2/__init__.py", line 67, in <module>
    from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: dlopen(/Library/Python/2.7/site-packages/psycopg2/_psycopg.so, 2): Library not loaded:
@loader_path/../lib/libssl.dylib
  Referenced from: /usr/lib/libpq.5.dylib
  Reason: Incompatible library version: libpq.5.dylib requires version 1.0.0 or later, but libssl.0.9.8.dylib provides version
0.9.8

我在这里想念的是什么。

1 个答案:

答案 0 :(得分:0)

那里有一个非常相似的问题(答案):python pip install psycopg2 install error

你见过吗?