proshop_django icon indicating copy to clipboard operation
proshop_django copied to clipboard

ModuleNotFoundError: No module named 'rest_framework'

Open kmrn777 opened this issue 2 years ago • 4 comments

i try to run your project (python manage.py runserver) and what i get on cmd is: Watching for file changes with StatReloader Exception in thread django-main-thread: Traceback (most recent call last): File "C:\Users\kmrn_\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in bootstrap_inner self.run() File "C:\Users\kmrn\AppData\Local\Programs\Python\Python310\lib\threading.py", line 946, in run self.target(*self.args, **self.kwargs) File "C:\Users\kmrn\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper fn(*args, **kwargs) File "C:\Users\kmrn\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run autoreload.raise_last_exception() File "C:\Users\kmrn\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception raise exception[1] File "C:\Users\kmrn\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management_init_.py", line 398, in execute autoreload.check_errors(django.setup)() File "C:\Users\kmrn_\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper fn(*args, **kwargs) File "C:\Users\kmrn_\AppData\Local\Programs\Python\Python310\lib\site-packages\django_init_.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "C:\Users\kmrn_\AppData\Local\Programs\Python\Python310\lib\site-packages\django\apps\registry.py", line 91, in populate app_config = AppConfig.create(entry) File "C:\Users\kmrn_\AppData\Local\Programs\Python\Python310\lib\site-packages\django\apps\config.py", line 228, in create import_module(entry) File "C:\Users\kmrn_\AppData\Local\Programs\Python\Python310\lib\importlib_init_.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1004, in _find_and_load_unlocked ModuleNotFoundError: No module named 'rest_framework'

kmrn777 avatar May 25 '22 17:05 kmrn777

Did you press the green run button on repliy?

On Wed, May 25, 2022 at 10:01 AM kmrn777 @.***> wrote:

i try to run your project (python manage.py runserver) and what i get on cmd is: Watching for file changes with StatReloader Exception in thread django-main-thread: Traceback (most recent call last): File "C:\Users\kmrn_\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in

bootstrap_inner self.run() File "C:\Users\kmrn\AppData\Local\Programs\Python\Python310\lib\threading.py", line 946, in run self.

*target(*self.args, **self.kwargs) File "C:\Users\kmrn\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper fn(*args, *kwargs) File "C:\Users\kmrn\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run autoreload.raise_last_exception() File "C:\Users\kmrn\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception raise exception[1] File "C:\Users\kmrn \AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\management_ init.py", line 398, in execute autoreload.check_errors(django.setup)() File "C:\Users\kmrn\AppData\Local\Programs\Python\Python310\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper fn(*args, **kwargs) File "C:\Users\kmrn_\AppData\Local\Programs\Python\Python310\lib\site-packages\django_ init.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "C:\Users\kmrn\AppData\Local\Programs\Python\Python310\lib\site-packages\django\apps\registry.py", line 91, in populate app_config = AppConfig.create(entry) File "C:\Users\kmrn_\AppData\Local\Programs\Python\Python310\lib\site-packages\django\apps\config.py", line 228, in create import_module(entry) File "C:\Users\kmrn_\AppData\Local\Programs\Python\Python310\lib\importlib_ init_.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1050, in _gcd_import File "", line 1027, in _find_and_load File "", line 1004, in _find_and_load_unlocked ModuleNotFoundError: No module named 'rest_framework'

— Reply to this email directly, view it on GitHub https://github.com/divanov11/proshop_django/issues/26, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOQDF4B3WYBXZM6WUHXC4GLVLZMFLANCNFSM5W5ZDEZQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Gabriel7553 avatar May 25 '22 17:05 Gabriel7553

@Gabriel7553 excuse me?

kmrn777 avatar May 25 '22 17:05 kmrn777

If you are using windows you should use virtualenv then run the server 1 -first install it by using this commnd line in root project pip install virtualenv 2 - create your virtual env by typing: virtualenv myenv 4 -then run your virtualenv : myenv\scripts\activate , if you are using mac type : source myenv/bin/activate 5 - then run server : python manage.py runserver

ftp5500 avatar Jun 22 '22 09:06 ftp5500

Make sure you run: pip install djangorestframework This will install the required module.

To check if you have it installed, run: pip list This will display all the modules you have installed.

Good Luck!

Rhys-Alexander avatar Jul 29 '22 08:07 Rhys-Alexander