0

I am trying to run a basic hello world python program with python 2.7.5 in PowerShell (Windows 10). I created the file helloworld.py and can see the file in my current directory - however, when I try to run that file in the current directory, I get an errno 2 message that the file cannot be found:

screenshot of PowerShell

My path values appear to be set correctly for both user and system variables - I have no issue launching python in PowerShell:

screenshot of path values

I have also confirmed that python is the default open with program for .py files and that the file is not hidden and not read only.

Any idea what might be causing this error?

4
  • Try python .\helloworld.py Commented Mar 5, 2017 at 8:00
  • Hey Mark - I just gave that a try and I get the same errno 2 result. Commented Mar 5, 2017 at 16:09
  • Try ./helloworld.py as well, read that somewhere Commented Mar 5, 2017 at 16:10
  • Thanks, Mark - I still got the same result running with ./. I ended up copying my file and underlying folder structure from Windows\System32 to a new folder in C: and now it's working. Commented Mar 5, 2017 at 17:02

1 Answer 1

1

I ended up copying my file and underlying folder structure from the original Windows\System32 location to a new folder in C: and now it's working.

Sign up to request clarification or add additional context in comments.

1 Comment

Permissions then I guess. Was your powershell console run as admin?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.