So I was following the tutorial on some basic set-up (cloning the folder onto my own pc) of a project
If you have chosen to install python (and already set up PATH variable for python.exe) then follow the instructions:
Open the command prompt and change the directory to the project folder as mentioned above by running the below command
cd C:/your cloned project folder path goes here/
then run the below command
python.exe C:/your cloned project folder path goes here/
And then I got:
C:Usersuser_nameproject_name>python.exe C:Usersuser_nameproject_name C:Usersuser_nameAppDataLocalMicrosoftWindowsAppsPythonSoftwareFoundation.Python.3.8_abc1d2efgh3i4python.exe: can't find '__main__' module in 'C:\Users\user_name\project_name'
when I entered the second command. (note: I cloned the project folder to user_nameproject_name).
Yet I can’t find much helpful information for this problem as it usually appears within python but not the command prompt of the computer itself. I have checked that I did set up the PATH variable for python.exe. And the path I entered for the 2 commands is the same. What may be wrong and how do I fix it?
Here is the cap screen of the content I was running, if helpful. The parts covered by blue are just user_name and project_name and some irrelevant information. click to see cap screen (I am not allowed to embed pictures in posts as I haven’t earned enough reputation.)
Advertisement
Answer
You see this error because C:Usersuser_nameproject_name
is a folder and python doesn’t know how to handle it. Instead, you need to specify the name of a python script. These are files that usually end with a .py
extension.