Django - ModuleNotFoundError: No module named 'bootstrap5'

Django - ModuleNotFoundError: No module named 'bootstrap5'

我正在尝试 运行 一个由其他开发人员制作的 django 应用程序。首先,我得到了 *ModuleNotFoundError: No module named 'django_heroku'*,这是通过 pip install django-heroku 解决的。现在我收到这个错误。

ModuleNotFoundError: No module named 'bootstrap5'

然后我就这样做了

pip install django-bootstrap5

貌似安装了bootstrap5。但是当我再次尝试 运行 时,我得到的应用程序是一样的 error.Here 就是它显示的内容。

(venv) D:\django\multi-vendor-shop-management-main>python manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "C:\Python39\lib\threading.py", line 973, in _bootstrap_inner
    self.run()
  File "C:\Python39\lib\threading.py", line 910, in run
    self._target(*self._args, **self._kwargs)
  File "D:\django\venv\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "D:\django\venv\lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run
    autoreload.raise_last_exception()
  File "D:\django\venv\lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception
    raise _exception[1]
  File "D:\django\venv\lib\site-packages\django\core\management\__init__.py", line 398, in execute
    autoreload.check_errors(django.setup)()
  File "D:\django\venv\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "D:\django\venv\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "D:\django\venv\lib\site-packages\django\apps\registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "D:\django\venv\lib\site-packages\django\apps\config.py", line 228, in create
    import_module(entry)
  File "C:\Python39\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'bootstrap5'

当我再次执行 pip install django-bootstrap5 时,它给了我这个

(venv) D:\django>pip install django-bootstrap5
Requirement already satisfied: django-bootstrap5 in d:\django\venv\lib\site-packages (21.3)
Requirement already satisfied: Django>=2.2 in d:\django\venv\lib\site-packages (from django-bootstrap5) (4.0.4)
Requirement already satisfied: beautifulsoup4>=4.8.0 in d:\django\venv\lib\site-packages (from django-bootstrap5) (4.11.1)
Requirement already satisfied: soupsieve>1.2 in d:\django\venv\lib\site-packages (from beautifulsoup4>=4.8.0->django-bootstrap5) (2.3.2.post1)
Requirement already satisfied: sqlparse>=0.2.2 in d:\django\venv\lib\site-packages (from Django>=2.2->django-bootstrap5) (0.4.2)
Requirement already satisfied: tzdata in d:\django\venv\lib\site-packages (from Django>=2.2->django-bootstrap5) (2022.1)
Requirement already satisfied: asgiref<4,>=3.4.1 in d:\django\venv\lib\site-packages (from Django>=2.2->django-bootstrap5) (3.5.1)
WARNING: You are using pip version 21.2.3; however, version 22.1 is available.
You should consider upgrading via the 'D:\django\venv\Scripts\python.exe -m pip install --upgrade pip' command.

我现在可以做什么?我是 django 的新手。

安装 django-bootstrap-v5 的首选方式是:

$ pip 安装 django-bootstrap-v5

根据documentation