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> 
Asked By: Janice Ng

||

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.

Answered By: Manzeer Fasaludeen

you can try this one:
cd mysite
python manage.py

Answered By: amulya

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.

Answered By: matpvl

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.

Answered By: Snowden

find the right location of manage.py and navigate path using cd, then run..python.exe manage.py runserver

Answered By: isha savaliya

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

Answered By: Ashok kumar P S
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.