1

So for some reason, my computer refuses to see the environment PATH variable. In the path variable, I have:

C:\Python32;

listed, along with all of the other programs, but it doesn't work if I type, "python" into the command window. However, I can type "python" into the run window, and have it run the correct interpreter (I assume because I have an environment variable for that separately...? As you can see, I don't quite understand how to customize this stuff. Any help would be appreciated!

SolarLune
  • 715
  • 2
  • 7
  • 10
  • 3
    http://docs.python.org/using/windows.html – Blender Oct 12 '11 at 16:25
  • Tried both your and lc's ideas, but it didn't work. I have the Python path listed in my environment PATH list, but typing 'python' into the command window doesn't work. I guess the real question is, "How would I configure my path variables so that I could type 'python' into a command window and start up my Python installation present in C:\Python32?" – SolarLune Oct 12 '11 at 18:11

5 Answers5

4

I faced the same issue.

However, in my case, I went through the documentation from python and found where I was making mistake. In the latest python versions, if you type 'python' in cmd, it will show error. At the same time, the command that worked for me was 'py'.

So I recommend anyone facing a similar problem to try this - 'py'

Tobias Wilfert
  • 919
  • 3
  • 14
  • 26
BSuraj93
  • 41
  • 1
  • 2
    Please have a look at [this answer](https://stackoverflow.com/a/50896577/): `py` is the _Python launcher_ which is a utility that comes with Python installations on Windows. So, `python` and `py` are two different things. You should _always_ be able to launch `python` if you have it on `%PATH%`. – Adrian W Dec 10 '18 at 16:02
  • That was a very useful answer. So, is it safe to assume that we can use 'py' also in the same way as python. I mean, can we perform everything using the launcher also? – BSuraj93 Dec 11 '18 at 16:21
  • The launcher can be seen as an enhancement. So, it is able to do things a bare bone Python does not, such as choosing a python version If you have several versions installed or virtual commands from shebang lines. Basic info [here](https://docs.python.org/3/using/windows.html#launcher), detailed info [here](https://www.python.org/dev/peps/pep-0397/). Since the python launcher is an optional component, I would not recommend to rely on it. – Adrian W Dec 11 '18 at 21:00
3

I know it's been a while, but I hope this could help someone else.

I had the same problem and the only way to making it work was running cmd or powershell as administrator.

Frannito
  • 75
  • 12
2

You can confirm if python is in your environment variables by looking at the output of echo

%path%

Keep in mind that after editing the PATH variable using the control panel, you have to open a new terminal, as the setting will NOT be updated in existing terminals.

Another possibility is that you added the wrong path to the PATH variable. Verify it.

The bottom line is, if the directory of your python.exe is really in PATH, then running python will really work.

pyjavo
  • 1,598
  • 2
  • 23
  • 41
0

I faced the same problem. Add more specific folders to your path. For example I added this and it seemed to work out! :)

C:\Python35-32;C:\Python35-32\Lib\site-packages\;C:\Python35-32\Scripts\;

To check if it is set successfully, type python in command prompt

enter image description here

QoP
  • 27,388
  • 16
  • 74
  • 74
0

Try what is written here on the official documentation.

lc2817
  • 3,722
  • 16
  • 40
  • 1
    Note that if you're using Windows 7, you have to add a step. After clicking "Properties", click the "Advance System Settings" link on the left of the window. Then you can go to the "Advanced" tab and continue from there. – sep332 Oct 12 '11 at 16:29
  • Tried it, but it didn't work. :( Thanks for the effort though. EDIT: By 'It', I mean that I tried 'set PYTHONPATH = %PYTHONPATH%; C:\Python32', but calling the 'python' command still didn't work. Any other ideas? Or possibly a more precise place to point me? – SolarLune Oct 12 '11 at 18:12