Did the other python scripts you ran have imports
Let me try and elaborate more. When windows runs it, it gets this import that it cannot find because it just looks in the same directory. When it is run with Python (python sample.py), Python knows to also look in another folder located somewhere on the computer holding the imports.
I don't really understand your problem here tho. Were you just asking about it? Wanted to fix it? The only way to fix this is to just use python to run the file as in "python sample.py" in the cmd, or run it as an .exe, or just run it from the IDLE or IDE.
Let me try and elaborate more. When windows runs it, it gets this import that it cannot find because it just looks in the same directory. When it is run with Python (python sample.py), Python knows to also look in another folder located somewhere on the computer holding the imports.
I don't really understand your problem here tho. Were you just asking about it? Wanted to fix it? The only way to fix this is to just use python to run the file as in "python sample.py" in the cmd, or run it as an .exe, or just run it from the IDLE or IDE.