我已经将Django安装在一个virtualenvwrapper
实例中,我在这个实例上安装了South。然而
调用python manage.py syncdb
时,virtualenvwrapper
外部的Django安装被调用,但找不到{
[~/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
编辑:我试过“南方”和“南方”设置.py. 这个设置.py文件如下所示。
编辑:将回溯替换为在中使用“south”生成的新回溯设置.py重新安装南部
EDIT2:which django-admin.py
/home/sdye/.virtualenvs/django_gilgamesh/bin/django的输出-管理员py在
更新:在命令行上测试时,import south
给出ImportError:没有名为south的模块
解决:python似乎在virtualenvwrapper实例之外寻找南方。当我在关闭virtualenv之后安装了south,迁移就成功了。这就产生了另一个问题,我将在一个新的帖子中发表。在
注意:由于我使用的是安装在virtualenvwrapper实例中的django,所以不应该发生这种情况
有谁知道如何解决这个问题,或者更好地解释为什么会发生这种情况?在
相关问题 更多 >
编程相关推荐