繁体   English   中英

python manage.py syncdb错误:没有名为“ south”的模块。 Virtualenvwrapper外部的Django安装称为

[英]python manage.py syncdb error: No module named south. Django installation outside Virtualenvwrapper called

我在安装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

编辑:我已经在settings.py中尝试了“南”和“南”。 settings.py文件如下所示。 编辑:用在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:没有名为南方的模块

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

注意:由于我正在使用virtualenvwrapper实例中安装的django,因此不应发生

任何人都有一个想法如何解决此问题,或者对为什么发生这种情况有更好的解释?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM