Django ImportError:无法导入设置

时间:2014-02-28 10:56:27

标签: python django importerror

我收到了以下错误。在git pull and merge之前,一切都运行良好。我检查了历史记录以找到删除任何文件等。

  • 我查了here。我已经检查了stackoverflow上的其他ans但是,它没有解决问题。
  • 我查了sys.path。项目目录路径存在于sys.path中。
  • 有人提及验证__init__.py文件夹中的myapp文件。它存在。
  • 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

2 个答案:

答案 0 :(得分:3)

您使用的是bootstrap3,而PYTHONPATH可能未安装,可能未安装。

原始错误为No module named bootstrap3,请检查bootstrap3模块。

答案 1 :(得分:-1)

您必须安装requirements.txt才可以! 在shell中运行此命令:

pip install -r requirements.txt