Django-eCommerce-tutorial-manascode icon indicating copy to clipboard operation
Django-eCommerce-tutorial-manascode copied to clipboard

No module named 'rest_framework' and 'drf_spectacular'

Open tiomchik opened this issue 1 year ago • 0 comments

Describe the bug Trying to start the project, but occurs ModuleNotFoundError. Here is traceback:

➜ py manage.py runserver
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "C:\Python311\Lib\threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "C:\Python311\Lib\threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "C:\tioma\piton_karoch\Django-eCommerce-tutorial-manascode\.venv\Lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "C:\tioma\piton_karoch\Django-eCommerce-tutorial-manascode\.venv\Lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run
    autoreload.raise_last_exception()
  File "C:\tioma\piton_karoch\Django-eCommerce-tutorial-manascode\.venv\Lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception
    raise _exception[1]
  File "C:\tioma\piton_karoch\Django-eCommerce-tutorial-manascode\.venv\Lib\site-packages\django\core\management\__init__.py", line 394, in execute
    autoreload.check_errors(django.setup)()
  File "C:\tioma\piton_karoch\Django-eCommerce-tutorial-manascode\.venv\Lib\site-packages\django\utils\autoreload.py", line 64, in wrapper
    fn(*args, **kwargs)
  File "C:\tioma\piton_karoch\Django-eCommerce-tutorial-manascode\.venv\Lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\tioma\piton_karoch\Django-eCommerce-tutorial-manascode\.venv\Lib\site-packages\django\apps\registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\tioma\piton_karoch\Django-eCommerce-tutorial-manascode\.venv\Lib\site-packages\django\apps\config.py", line 193, in create
    import_module(entry)
  File "C:\Python311\Lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'rest_framework'

And the same with drf_spectacular module.

To Reproduce Follow the instructions from the README.

Expected behavior The project starts without any errors.

Screenshots

Desktop (please complete the following information):

  • OS: Windows 10 22H2
  • Browser: Firefox
  • Version: 127.0.1

Smartphone (please complete the following information):

Additional context I've already figured out how to solve this issue and will send a pull request as soon as possible.

tiomchik avatar Jun 25 '24 06:06 tiomchik