我安装了django并在eclipse下安装了pydev插件。然后我下载了postgres(1.16.0)sql工具并安装了它。以下是我的设置:
然后我想在django:
下配置设置文件DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2' ,
'NAME': 'django',
'USER': 'postgres',
'PASSWORD': 'admin',
'HOST': '',
'PORT': '',
}
}
但是当我执行syncdb时,我得到:
backend = load_backend(db['ENGINE'])
File "C:\Python27\lib\site-packages\django\db\utils.py", line 24, in load_backend
return import_module('.base', backend_name)
File "C:\Python27\lib\site-packages\django\utils\importlib.py", line 35, in import_module
__import__(name)
File "C:\Python27\lib\site-packages\django\db\backends\postgresql_psycopg2\base.py", line 13, in <module>
from django.db.backends.postgresql_psycopg2.creation import DatabaseCreation
File "C:\Python27\lib\site-packages\django\db\backends\postgresql_psycopg2\creation.py", line 1, in <module>
import psycopg2.extensions
ImportError: No module named psycopg2.extensions
我做错了什么?
PS:我在win7和eclipse juno下开发
答案 0 :(得分:1)