I created a project in django normally, but when I try to run the server (python manager.py runserver) I get the following error: C:\Users\Fredy\AppData\Local\Programs\Python\Python39\python.exe: can't open file 'C:\Downloads\django_one\manager.py': [Errno 2] No such file or directory
The strange thing is that the manager.py file is there. I went back to other projects that I had already created that were working and the same error occurred. Does anyone know how I fix this?
CodePudding user response:
use "python manage.py runserver". If you look at the files, it has a "manage.py" and not "manager.py"
CodePudding user response:
Usually this happens because you are not in the root directory of the project. Judging by the screenshot it looks like you are, but worth a double check.
There are a few possible solutions:
chmod x manage.py
(manage.py may have lost execute permissions)- Did you forget to activate the virtual environment?
- Your installation of Django may not support Python 3.9 (Django 3.2 supports Python versions 3.6, 3.7, 3.8, 3.9, 3.10)
Some sources to look into:
python: can't open file 'manage.py': [Errno 2] No such file or directory
https://www.pythonanywhere.com/forums/topic/756/
https://docs.djangoproject.com/en/3.2/ref/django-admin/
https://docs.djangoproject.com/en/3.2/faq/install/
I hope this gives some direction. Good Luck