ImportError: No module named south.v2 but I don't use south

ImportError: No module named south.v2 but I don't use south

我在新安装的 lubuntu 16.04 上 运行ning django 1.9。我创建了一个虚拟环境并从 github 克隆了我的存储库。我尝试 运行 ./manage.py runserver 并收到错误消息:

ImportError: No module named south.v2

我检查过其他类似的问题,但它们似乎暗示我是从南方升级的,我已经多年没有使用过,也从未在这个存储库上升级。

Traceback (most recent call last):
  File "/home/jcg/.virtualenvs/baseball/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/home/jcg/.virtualenvs/baseball/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run
    self.check_migrations()
  File "/home/jcg/.virtualenvs/baseball/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 163, in check_migrations
    executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
  File "/home/jcg/.virtualenvs/baseball/local/lib/python2.7/site-packages/django/db/migrations/executor.py", line 20, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/home/jcg/.virtualenvs/baseball/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 49, in __init__
    self.build_graph()
  File "/home/jcg/.virtualenvs/baseball/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 170, in build_graph
    self.load_disk()
  File "/home/jcg/.virtualenvs/baseball/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 105, in load_disk
    migration_module = import_module("%s.%s" % (module_name, migration_name))
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/jcg/.virtualenvs/baseball/local/lib/python2.7/site-packages/django_extensions/migrations/0001_empty.py", line 2, in <module>
    from south.v2 import SchemaMigration
ImportError: No module named south.v2

这是我的 pip 冻结结果:

chardet==2.2.1
Django==1.9.2
django-appconf==0.6
django-bootstrap3==6.2.2
django-csvimport==1.0
django-debug-toolbar==1.4
django-extensions==1.5.0
docutils==0.12
gunicorn==19.4.5
Markdown==2.6.5
Pygments==2.1.1
six==1.7.3
sqlparse==0.1.18

将您的 django-extension 更新到最新版本 1.6.7:

pip install django-extensions==1.6.7

旧版本使用 south 进行迁移,而新版本使用 1.6 版本中引入的 django 默认迁移