ModuleNotFoundError:没有名为' bootstrapform'

时间:2017-12-23 02:33:57

标签: python django

我收到一个错误,ModuleNotFoundError:没有名为' bootstrapform' 。 当我运行python manage.py runserver时,会发生此错误。 Traceback说



    Traceback (most recent call last):
      File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/utils/autoreload.py", line 228, in wrapper
        fn(*args, **kwargs)
      File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run
        autoreload.raise_last_exception()
      File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/utils/autoreload.py", line 251, in raise_last_exception
        six.reraise(*_exception)
      File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/utils/six.py", line 685, in reraise
        raise value.with_traceback(tb)
      File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/utils/autoreload.py", line 228, in wrapper
        fn(*args, **kwargs)
      File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/__init__.py", line 27, in setup
        apps.populate(settings.INSTALLED_APPS)
      File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/apps/registry.py", line 85, in populate
        app_config = AppConfig.create(entry)
      File "/Users/XXX/anaconda/envs/py36/lib/python3.6/site-packages/django/apps/config.py", line 94, in create
        module = import_module(entry)
      File "/Users/XXX/anaconda/envs/py36/lib/python3.6/importlib/__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 978, in _gcd_import
      File "<frozen importlib._bootstrap>", line 961, in _find_and_load
      File "<frozen importlib._bootstrap>", line 948, in _find_and_load_unlocked
    ModuleNotFoundError: No module named 'bootstrapform'
&#13;
&#13;
&#13;

我在settings.py中写道

import os

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
STATIC_URL = '/static/'

STATICFILES_DIRS = [os.path.join(BASE_DIR,'bootflat.github.io'), ]

目录结构就像

-PythonServer
  -PythonServer
  -logic
   -static
    -index.css
   -templates
    -index.html
  -boolflat.github.io
  -bower_components

我运行pip install django-versatileimagefield == 1.2.2&amp; pip安装规则,但发生了同样的错误。我该如何修复此错误?

1 个答案:

答案 0 :(得分:0)

你安装了bootstrap-form吗?如果不是,请运行以下命令进行安装。

npm uninstall --save firebase

了解更多信息:https://django-bootstrap-form.readthedocs.io/en/latest/