'django_postgrespool' isn't an availab

2019-05-03 19:19发布

After installing django_postgrespool and configuring my project accordingly, I received the following error:

Traceback (most recent call last):
  File "C:\Users\Administrator\Documents\my_proj\my_module.py", line 14, in <module>
    from cortex.my_app.models import MyModel
  File "C:\Users\Administrator\Documents\my_proj\my_app\models.py", line 3, in <module>
    from django.db import models
  File "C:\Users\Administrator\virtual_environments\spyker\lib\site-packages\django\db\__init__.py", line 40, in <module>
    backend = load_backend(connection.settings_dict['ENGINE'])
  File "C:\Users\Administrator\virtual_environments\spyker\lib\site-packages\django\db\__init__.py", line 34, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "C:\Users\Administrator\virtual_environments\spyker\lib\site-packages\django\db\utils.py", line 92, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "C:\Users\Administrator\virtual_environments\spyker\lib\site-packages\django\db\utils.py", line 44, in load_backend
    raise ImproperlyConfigured(error_msg)
django.core.exceptions.ImproperlyConfigured: 'django_postgrespool' isn't an available database backend.
Try using django.db.backends.XXX, where XXX is one of:
    'dummy', 'mysql', 'oracle', 'postgresql_psycopg2', 'sqlite3'
Error was: cannot import name Diagnostics

Of course I checked I can import django_postgrespool in the same env.
I found this similar issue, however its resolution was to use django 1.4+ and I'm using 1.4.3

2条回答
狗以群分
2楼-- · 2019-05-03 19:28

I find a solution that using psycopg2-2.6.1 instead of psycopg2-2.6.

I adjusted the version number in requirement.txt from 2.6 to 2.6.1 and everything is done!

查看更多
闹够了就滚
3楼-- · 2019-05-03 19:33

Uninstall psycopg2-2.5.1 and install psycopg2-2.4.6.

I don't know why it solves this problem, when psycopg2-2.5.1 is a requirement of the latest postgrespool. I am using Windows Python 2.7.3 AMD64. I've reported this as a bug to django-postgrespool

查看更多
登录 后发表回答