2014-02-28 46 views
2

我收到以下錯誤。在git拉和合並之前,一切工作正常。我檢查的歷史找到去除我已經檢查here任何文件等Django ImportError:無法導入設置

  • 的。我已經檢查了其他答案在stackoverflow但它並沒有解決問題。
  • 我已查詢sys.path。項目目錄路徑存在於sys.path中。
  • 有人提到在myapp文件夾中驗證__init__.py文件。它存在。
  • Bootstrap3軟件包安裝在系統中。我跑python setup.py develop再次。

不知道該如何調試?

$ python manage.py runserver 
Traceback (most recent call last): 
    File "manage.py", line 10, in <module> 
    execute_from_command_line(sys.argv) 
    File "/usr/local/lib/python2.7/dist-packages/Django-1.5.4-py2.7.egg/django/core/management/__init__.py", line 453, in execute_from_command_line 
    utility.execute() 
    File "/usr/local/lib/python2.7/dist-packages/Django-1.5.4-py2.7.egg/django/core/management/__init__.py", line 392, in execute 
    self.fetch_command(subcommand).run_from_argv(self.argv) 
    File "/usr/local/lib/python2.7/dist-packages/Django-1.5.4-py2.7.egg/django/core/management/__init__.py", line 263, in fetch_command 
    app_name = get_commands()[subcommand] 
    File "/usr/local/lib/python2.7/dist-packages/Django-1.5.4-py2.7.egg/django/core/management/__init__.py", line 109, in get_commands 
    apps = settings.INSTALLED_APPS 
    File "/usr/local/lib/python2.7/dist-packages/Django-1.5.4-py2.7.egg/django/conf/__init__.py", line 53, in __getattr__ 
    self._setup(name) 
    File "/usr/local/lib/python2.7/dist-packages/Django-1.5.4-py2.7.egg/django/conf/__init__.py", line 48, in _setup 
    self._wrapped = Settings(settings_module) 
    File "/usr/local/lib/python2.7/dist-packages/Django-1.5.4-py2.7.egg/django/conf/__init__.py", line 134, in __init__ 
    raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e)) 
ImportError: Could not import settings 'myapp.settings' (Is it on sys.path?): No module named bootstrap3 
+1

是DJANGO_SETTINGS_MODULE如何正確在環境在設置? – maazza

+0

你使用virtualenv嗎?它被激活了嗎?是否安裝了所有必需的模塊('''pip freeze'''應該返回已安裝模塊的列表)。 –

回答

3

您正在使用bootstrap3及其可能在PYTHONPATH將沒有安裝或沒有。

原始錯誤爲No module named bootstrap3,請檢查bootstrap3模塊。

+1

我想他提到'Bootstrap3軟件包已安裝在系統中。' –

+0

你會在python控制檯中嘗試'import bootstrap3'嗎? – Nilesh

+0

這不太可能是問題所在。 – holdenweb

-1

你必須安裝requirements.txt,它會好的! 在你的shell運行此命令:

pip install -r requirements.txt 
+0

可以沒有requirements.txt。 –

+0

爲什麼不呢?我現在安裝它,問題解決了 – MaryamH

相關問題