我在普通的 python shell 中,尝试导入我的项目模型时出现此错误:
from results.models import TestResult
Traceback (most recent call last):
File "C:\Program Files (x86)\Wing IDE 3.2\src\debug\tserver\_sandbox.py", line 1, in <module>
# Used internally for debug sandbox under external interpreter
File "C:\Users\audrey_moreau\myProject\results\models.py", line 1, in <module>
from django.db import models
File "c:\Python27\Lib\site-packages\django\db\__init__.py", line 40, in <module>
backend = load_backend(connection.settings_dict['ENGINE'])
File "c:\Python27\Lib\site-packages\django\db\__init__.py", line 34, in __getattr__
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "c:\Python27\Lib\site-packages\django\db\utils.py", line 92, in __getitem__
backend = load_backend(db['ENGINE'])
File "c:\Python27\Lib\site-packages\django\db\utils.py", line 54, 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\sqlite3\base.py", line 14, in <module>
from django.db import utils
ImportError: cannot import name utils
谁能给我一个关于如何解决这个问题的指示?我正在使用 Python 2.7。