I installed bootstrap4 with
$ pip install django-bootstrap4
It is being installed in this directory
C:Userstradetechpit-match-envLibsite-packages
Django seems to be looking at this directory
C:UserstradeAnaconda3libsite-packagesdjango
When I put ‘bootstrap4’ in the INSTALLED_APPS = (‘bootstrap4’) variable and then run
$ python manage.py runserver
I get this error
JavaScript
x
26
26
1
C:Userstradetechpit-match-envScriptstechpit>python manage.py runserver
2
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x000001C4D8F65488>
3
Traceback (most recent call last):
4
File "C:UserstradeAnaconda3libsite-packagesdjangoutilsautoreload.py", line 225, in wrapper
5
fn(*args, **kwargs)
6
File "C:UserstradeAnaconda3libsite-packagesdjangocoremanagementcommandsrunserver.py", line 113, in inner_run
7
autoreload.raise_last_exception()
8
File "C:UserstradeAnaconda3libsite-packagesdjangoutilsautoreload.py", line 248, in raise_last_exception
9
raise _exception[1]
10
File "C:UserstradeAnaconda3libsite-packagesdjangocoremanagement__init__.py", line 327, in execute
11
autoreload.check_errors(django.setup)()
12
File "C:UserstradeAnaconda3libsite-packagesdjangoutilsautoreload.py", line 225, in wrapper
13
fn(*args, **kwargs)
14
File "C:UserstradeAnaconda3libsite-packagesdjango__init__.py", line 24, in setup
15
apps.populate(settings.INSTALLED_APPS)
16
File "C:UserstradeAnaconda3libsite-packagesdjangoappsregistry.py", line 89, in populate
17
app_config = AppConfig.create(entry)
18
File "C:UserstradeAnaconda3libsite-packagesdjangoappsconfig.py", line 90, in create
19
module = import_module(entry)
20
File "C:UserstradeAnaconda3libimportlib__init__.py", line 126, in import_module
21
return _bootstrap._gcd_import(name[level:], package, level)
22
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
23
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
24
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
25
ModuleNotFoundError: No module named 'bootstrap4'
26
How can I resolve this error? I installed bootstrap4 in the django folder by using copy and paste and that did not work. Any help would be greatly appreciated.
Thank You!
Advertisement
Answer
JavaScript
1
2
1
python -m pip install bootstrap4
2
This locates pip on the python module path, thus ensuring that you install bootstrap4
in the same python environment that you use to run the manage.py
commands. See this.