首页 文章

python manage.py syncdb错误:没有名为south的模块 . 在Virtualenvwrapper外面的Django安装叫

提问于
浏览
0

我在安装了South的 virtualenvwrapper 实例中安装了Django . 但是当调用 python manage.py syncdb 时,调用 virtualenvwrapper 之外的Django安装并且找不到 south . 我该如何解决?

[~/devground/django_gilgamesh]# pip install south
Downloading/unpacking south
  Downloading South-0.8.4-py2.py3-none-any.whl (135kB): 135kB downloaded
Installing collected packages: south
Successfully installed south
Cleaning up...
(django_gilgamesh)sdye@dy-borg.com [~/devground/django_gilgamesh]# python manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/sdye/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in   execute_from_command_line
    utility.execute()
  File "/home/sdye/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/sdye/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/sdye/lib/python2.7/site-packages/django/core/management/base.py", line 280, in execute
    translation.activate('en-us')
  File "/home/sdye/lib/python2.7/site-packages/django/utils/translation/__init__.py", line 130, in activate
    return _trans.activate(language)
  File "/home/sdye/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 188, in activate
    _active.value = translation(language)
  File "/home/sdye/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 177, in translation
    default_translation = _fetch(settings.LANGUAGE_CODE)
  File "/home/sdye/lib/python2.7/site-packages/django/utils/translation/trans_real.py", line 159, in _fetch
    app = import_module(appname)
  File "/home/sdye/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
ImportError: No module named south

编辑:我've tried both '南' and '南' in settings.py. The settings.py file is shown below. EDIT: Replaced traceback with new traceback generated using '南'在settings.py并重新安装南EDIT2:输出 which django-admin.py /home/sdye/.virtualenvs/django_gilgamesh/bin/django-admin.py

BASE_DIR = os.path.dirname(os.path.dirname(__file__))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'p3)1ravw(zzt25-$tj0fd@r8^i1(0b1==tuk5e3ph32k8yjs20'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

TEMPLATE_DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'south',
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'django_gilgamesh.urls'

WSGI_APPLICATION = 'django_gilgamesh.wsgi.application'

更新:在命令行上进行测试时 import south 给出了ImportError:没有名为south的模块

1 回答

  • 1

    解决:看起来python在virtualenvwrapper实例的南边寻找 . 当我在关闭virtualenv之后安装南部时,迁移工作 . 这会产生另一个我将在新线程中发布的问题 .

    注意:因为我在virtualenvwrapper实例中使用了django,所以不应该这样

    任何人都有一个想法如何解决这个或更好的解释为什么会发生这种情况?

相关问题