ImportError:没有名为south.v2的模块,但我不使用south

时间:2016-05-12 17:47:43

标签: django python-2.7 django-south

我在新安装的lubuntu 16.04上运行django 1.9。我创建了一个虚拟环境并从github克隆了我的存储库。我尝试运行e+=chr(f-24) ^ IndentationError: unindent does not match any outer indentation level 并收到错误:

./manage.py runserver

我已经检查了其他类似的问题,但它们似乎暗示我正在从南方升级,我已经使用多年了,而且从未在此存储库中使用过。

ImportError: No module named south.v2

这是我的pip冻结结果:

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

1 个答案:

答案 0 :(得分:1)

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

pip install django-extensions==1.6.7

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