2
我試圖讓一個Django應用程序啓動並運行。這些庫有點過時(它目前在Django 1.4上)。ImportError:無法導入名稱SortedDict - 只在Python 2.7上,而不是2.6
我有或多或少的工作時,我試圖蟒蛇2.6,但是當我使用Python 2.7更改爲virtualenv中我得到的錯誤:
Unhandled exception in thread started by <function wrapper at 0x7f057b17c320>
Traceback (most recent call last):
File "/home/colin/software/virtualenvs/barshool/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/home/colin/software/virtualenvs/barshool/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "/home/colin/software/virtualenvs/barshool/lib/python2.7/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception
six.reraise(*_exception)
File "/home/colin/software/virtualenvs/barshool/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/home/colin/software/virtualenvs/barshool/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/colin/software/virtualenvs/barshool/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/home/colin/software/virtualenvs/barshool/lib/python2.7/site-packages/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/colin/software/virtualenvs/barshool/lib/python2.7/site-packages/transmeta/__init__.py", line 7, in <module>
from django.utils.datastructures import SortedDict
ImportError: cannot import name SortedDict
我成立了virtualenvs具有相同要求的文件。
可能導致此問題的版本之間有什麼區別?
謝謝,現在我檢查了一下,我確實設法在該virtualenv中安裝了1.9版。根據需求文件,我認爲我有1.4.5。 –