當我試圖運行python manage.py runserver命令我得到這個錯誤:Django的:沒有模塊名爲設置
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/Users/user/lokvi/lokvi_env/lib/python2.7/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/Users/user/lokvi/lokvi_env/lib/python2.7/site-packages/django/core/management/__init__.py", line 307, in execute
settings.INSTALLED_APPS
File "/Users/user/lokvi/lokvi_env/lib/python2.7/site-packages/django/conf/__init__.py", line 56, in __getattr__
self._setup(name)
File "/Users/user/lokvi/lokvi_env/lib/python2.7/site-packages/django/conf/__init__.py", line 41, in _setup
self._wrapped = Settings(settings_module)
File "/Users/user/lokvi/lokvi_env/lib/python2.7/site-packages/django/conf/__init__.py", line 110, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named settings
我有蟒蛇2.7在我的virtualenv。我注意到奇怪的事情在我的堆棧跟蹤的上次行,最後行前面具有路徑是這樣說:/lokvi_env/lib/python2.7
等
但最後一行是這樣認爲System/Library/Frameworks
等,所以它看起來像路徑已經從virtualenv到系統。可以嗎?
似乎有路徑不匹配..你使用的是Windows嗎? –
@MohideenibnMohammed,你的激活virtualenv嗎? – yerassyl
? –