I’ve just started learning python on the ATBS course and have been going for almost 2 months. I’m having trouble with the terminal and command prompt on my PC which is running on windows 10
I have a python file called mClip.py and I am trying to pass an argument called ‘agree’. I am trying to run this on the terimal.
Scenario 1: If I type:
PS G:my driveatbs6> python mclip.py agree*
then I get an error saying: C:UsersCool-sanAppDataLocalProgramsPythonPython312python.exe: can’t open file ‘G:my driveatbs6mclip.py’: [Errno 2] No such file or directory
However Scenario 2: if I type the exact same thing buy capitalise some letters then it successfully runs the python file. I.e. if I type:
PS G:My DriveATBS6> py mclip.py agree
then the terminal executes the file without problems
The funny thing is whether I type scenario 1 or 2 into my laptop (instead of PC), the terminal is able to execute the file without problems. The only difference I can think of between my laptop and PC is that the laptop is running windows 11 and PC is running windows 10.
I thought that the terminal wasn’t case sensitive so why does the command work on my PC when I capitalise some of the letters?
Basically if I type the exact same thing into the terminal but capitalise some of the letters the file is able to be executed without any problems. I only have this problem on my PC which is running windows 10 not my laptop which is running windows 11
hcb008 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
SIMILAR EXPERIENCE:
I experienced a similar issue not too long ago accessing Java classes via command prompt. In my situation I had issues with this:
javac C:Usersexample userProjectsSchoolJavaMyClass.java
Time after time I continued to get errors that the file path was not found, but it ended up working after I capitalized the folder and added spacing like this:
javac "C:UsersExample UserProjectsSchoolJavaMyClass.java
SOLUTION:
Use the Python launcher itself:
py "G:my driveatbs6mClip.py" agree
Double check case sensitivity despite it not usually being an issue on windows:
python "G:My DriveATBS6mClip.py" agree
Last but not least, enter the directory:
cd "G:my driveatbs6"
and try and execute it from there..
python mClip.py agree
This should work.
1