AttributeError:'module'对象没有属性'setup' - 无法运行开发服务器 [英] AttributeError: 'module' object has no attribute 'setup' - can't run development server
问题描述
我正在运行开发服务器,修改一些css,当服务器突然崩溃时,没有任何不寻常的事情。
I was running the development server, modifying some css, not doing anything unusual when suddenly the server crashes.
我尝试再次运行,并受到欢迎:
I tried running it again and was greeted with this:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/david/.virtualenvs/sikumim/lib/python3.4/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/home/david/.virtualenvs/sikumim/lib/python3.4/site-packages/django/core/management/__init__.py", line 312, in execute
django.setup()
AttributeError: 'module' object has no attribute 'setup'
我感到很困惑,因为我实际上没有做任何事情,似乎造成了这一点,谷歌搜索没有让我很远,基本上我被骗了。
I'm pretty confused seeing as I didn't actually do anything that seems to have caused this, google search didn't get me far, basically I'm stumped.
感谢提前的帮助
推荐答案
是否有可能安装了多个版本的django (可能是一个系统范围的,一个在virtualenv中)?
Is it possible that you have multiple versions of django installed (perhaps one system-wide, and one in a virtualenv)?
该错误将由调用从较新的(> = 1.7)django版本创建的 manage.py
在python路径上使用较旧的django软件包。
That error would be caused by calling a manage.py
created from a newer (>= 1.7) django version with an older django package on the python path.
这篇关于AttributeError:'module'对象没有属性'setup' - 无法运行开发服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!