I installed bootstrap4 with
$ pip install django-bootstrap4
It is being installed in this directory
C:\Users\trade\techpit-match-env\Lib\site-packages
Django seems to be looking at this directory
C:\Users\trade\Anaconda3\lib\site-packages\django
When I put 'bootstrap4' in the INSTALLED_APPS = ('bootstrap4') variable and then run
$ python manage.py runserver
I get this error
C:\Users\trade\techpit-match-env\Scripts\techpit>python manage.py runserver
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x000001C4D8F65488>
Traceback (most recent call last):
File "C:\Users\trade\Anaconda3\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "C:\Users\trade\Anaconda3\lib\site-packages\django\core\management\commands\runserver.py", line 113, in inner_run
autoreload.raise_last_exception()
File "C:\Users\trade\Anaconda3\lib\site-packages\django\utils\autoreload.py", line 248, in raise_last_exception
raise _exception[1]
File "C:\Users\trade\Anaconda3\lib\site-packages\django\core\management\__init__.py", line 327, in execute
autoreload.check_errors(django.setup)()
File "C:\Users\trade\Anaconda3\lib\site-packages\django\utils\autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "C:\Users\trade\Anaconda3\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\trade\Anaconda3\lib\site-packages\django\apps\registry.py", line 89, in populate
app_config = AppConfig.create(entry)
File "C:\Users\trade\Anaconda3\lib\site-packages\django\apps\config.py", line 90, in create
module = import_module(entry)
File "C:\Users\trade\Anaconda3\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'bootstrap4'
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!
python -m pip install bootstrap4
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.