Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ModuleNotFoundError: No module named 'rest_framework' #26

Open
kmrn777 opened this issue May 25, 2022 · 4 comments
Open

ModuleNotFoundError: No module named 'rest_framework' #26

kmrn777 opened this issue May 25, 2022 · 4 comments

Comments

@kmrn777
Copy link

kmrn777 commented May 25, 2022

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'

@Gabriel7553
Copy link

Gabriel7553 commented May 25, 2022 via email

@kmrn777
Copy link
Author

kmrn777 commented May 25, 2022

@Gabriel7553 excuse me?

@ftp5500
Copy link

ftp5500 commented Jun 22, 2022

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

@Rhys-Alexander
Copy link

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!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants