Can't run python manage.py runserver
Question:
Hello~ I have installed django-bootstrap-ui-2.0.0 and django-admin startproject, and tried both python and python3 manage.py runserver. However, it says that no such file or directory. Am I missing some functions that have to pip install? Much thanks!
C:UsersuserAppDataLocalProgramsPythonPython310python.exe: can't open file 'C:\
Users\user\PycharmProjects\Pyshop\manage.py': [Errno 2] No such file or directory
PS C:UsersuserPycharmProjectsPyshop>
Answers:
This could be because you haven’t activated the virtual environment. The basic reason is that the system is not able to find manage.py on that location.
you can try this one:
cd mysite
python manage.py
if you’re on windows pycharm can create the virtual env for you. if that’s the case try running
venvScriptsactivate
if it says that the script is disabled on this system then just run powershell as administrator and run this command:
set-executionpolicy remotesigned
then just input Accept all and that should be it.
I had the same problem, but its just because the ‘manage.py’ file was not in the right folder. Try to find where the ‘manage.py’ file is.
(venv) PS C:UsersDesktoptrabalhopython_allprojetao> python manage.py runserver
C:UsersAppDataLocalMicrosoftWindowsAppsPythonSoftwareFoundation.Python.3.10python.exe: can’t open file ‘C:UsersDesktoptrabalhopython_allprojetaomanage.py’: [Errno 2] No such file or directory
My ‘manage.py’ file was in "python_allprojetaosite" so i had to write = cd site
then it showed
PS C:UsersDesktoptrabalhopython_allsite>
Then python manage.py runserver worked for me.
find the right location of manage.py and navigate path using cd, then run..python.exe manage.py runserver
while creation of a django project using VScode try to follow like this, by default manage.py is created for a project
django-admin startproject Ecommerce .
if you use space and .
system will create parental manage.py
Hello~ I have installed django-bootstrap-ui-2.0.0 and django-admin startproject, and tried both python and python3 manage.py runserver. However, it says that no such file or directory. Am I missing some functions that have to pip install? Much thanks!
C:UsersuserAppDataLocalProgramsPythonPython310python.exe: can't open file 'C:\
Users\user\PycharmProjects\Pyshop\manage.py': [Errno 2] No such file or directory
PS C:UsersuserPycharmProjectsPyshop>
This could be because you haven’t activated the virtual environment. The basic reason is that the system is not able to find manage.py on that location.
you can try this one:
cd mysite
python manage.py
if you’re on windows pycharm can create the virtual env for you. if that’s the case try running
venvScriptsactivate
if it says that the script is disabled on this system then just run powershell as administrator and run this command:
set-executionpolicy remotesigned
then just input Accept all and that should be it.
I had the same problem, but its just because the ‘manage.py’ file was not in the right folder. Try to find where the ‘manage.py’ file is.
(venv) PS C:UsersDesktoptrabalhopython_allprojetao> python manage.py runserver
C:UsersAppDataLocalMicrosoftWindowsAppsPythonSoftwareFoundation.Python.3.10python.exe: can’t open file ‘C:UsersDesktoptrabalhopython_allprojetaomanage.py’: [Errno 2] No such file or directory
My ‘manage.py’ file was in "python_allprojetaosite" so i had to write = cd site
then it showed
PS C:UsersDesktoptrabalhopython_allsite>
Then python manage.py runserver worked for me.
find the right location of manage.py and navigate path using cd, then run..python.exe manage.py runserver
while creation of a django project using VScode try to follow like this, by default manage.py is created for a project
django-admin startproject Ecommerce .
if you use space and .
system will create parental manage.py