Every Django project has a few automatically created Python scripts. The
django-admin.py script file provides command-line utilities for administrative tasks.
manager.py file is similar to the
django-admin.py script and is automatically created. It also performs additional tasks of setting the value of the
DJANGO_SETTINGS_MODULE environment variable to the path of the
settings.py script file of the project.
It also puts the path of the project’s package on the
This tutorial will discuss the below error in Python and how to fix it:
python: can't open file 'manage.py': [Errno 2] No such file or directory
Can't Open File 'manage.py': [Errno 2] No Such File or Directory Error in Python
This error can be seen while running the
python manage.py runserver command.
It is caused because we are not in the project’s root directory. The
manager.py file is in the root directory, and we need to be in this directory while running the command.
We cannot be in any project subdirectory and expect this command to run.
To fix this, redirect to the root directory using the
cd command and run the command. It should work fine.