0

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?

error image

2 Answers2

1

use "python manage.py runserver". If you look at the files, it has a "manage.py" and not "manager.py"

SG26
  • 38
  • 7
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 05 '21 at 15:09
0

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:

  1. chmod +x manage.py (manage.py may have lost execute permissions)
  2. Did you forget to activate the virtual environment?
  3. 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

TheLab
  • 1
  • 1
  • 1