通过
安装bootstrap3之后$ pip install django-bootstrap3
当我的virtualenv
处于有效状态时。即。
(venv)deathstroke@Batcomputer:~/Documents/DjangoProjects/venv/bin$ pip install django-bootstrap3
但是,给出了以下错误 -
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/deathstroke/Documents/DjangoProjects/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/home/deathstroke/Documents/DjangoProjects/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 312, in execute
django.setup()
File "/home/deathstroke/Documents/DjangoProjects/venv/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/deathstroke/Documents/DjangoProjects/venv/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/home/deathstroke/Documents/DjangoProjects/venv/local/lib/python2.7/site-packages/django/apps/config.py", line 119, in create
import_module(entry)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named bootstrap3
当我在shell中运行import bootstrap3
时,它可以工作。
为什么我的Django应用程序没有找到或识别它?
答案 0 :(得分:7)
显然INSTALLED APPS
包含'django_admin_bootstrapped.bootstrap3'
,但未被识别并引发错误。我用简单的'bootstrap3',
替换了它,它完美无缺。
答案 1 :(得分:0)
运行下面的命令
pip install django-bootstrap3
并在已安装的应用程序中添加 bootstrap3
有关信息,请转到下方 pypi.org/project/django-bootstrap3