0

I am trying to access Python through a Windows command prompt, but am at an office and cannot add an Environment Variable. So, I cant follow the advice provided here. Thus, I added a User Environment Variable through User Accounts and use Variable:python and Value: C:\Python33. When I do a Windows Run check on %python% I reach the required Python33 folder. However, when I type python -Version in the command prompt I get the error 'python' is not recognized as an internal or external command, operable program or batch file. I am not sure how to proceed.

4 Answers 4

4

Run Python from the command prompt and include the full path to python.exe. For example to get the version:

C:\Python33\python.exe --version

When you run a script you specify the path to the script if you're not in the directory where the script is located. For example, if your script is in C:\scripts and is called my_script.py:

C:\Python33\python.exe C:\scripts\my_script.py
Sign up to request clarification or add additional context in comments.

Comments

1

Instead of setting environment variables, you can use the whole path, like Neo wrote e.g.: C:\Python33\python.exe yourPythonScript.py

Remove any environment variables you have added.

Comments

1

C:\Python33\python.exe pyscript.py should work.

Comments

0

I once Had a similar problem, but i couldnt find any solution, not even adding the path to the python folder was working. Then I opened Python and clicked in File, then browser path, and I found that I had another folder that contained the real Python folder, not the default one. Maybe it could work for you too.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.