How to install Python on a recent Windows computer in C:Program Files?

Question:

I’m starting to get extremely FURIOUS with the latest Windows environments (Windows 10):

I’ve just downloaded and installed Python, version 3.9.
The installer proposed to install it under "C:Users…", I thought "No way, because if, for whatever reason, I remove this user, I might remove an installation of a program.", so I decided to install it under C:Program Files, which is the most obvious place to install something.

First, that was not allowed: apparently that directory has special permissions, so I have started the installer as administrator. Everything went OK (at least that’s how it looked): all files/directories seem to be present.

Then, I wanted to add some extra libraries, for which I wanted to launch pip3 install ..., but 'pip3' is not recognized as an internal or external command, operable program or batch file..
So in the Windows explorer, I typed file:pip* and indeed, nothing found.

Having a manual look into the directory C:Program FilesPythonPython3.9Scripts, I did find all pip versions (the normal one, the version 3 and the version 3.9 one), but having a look at my PATH environment variable, there seems to be nothing there, referring to my justly created C:Program FilesPython directory.

So, my questions are very simple:

  1. I am able to change my PATH variable myself, but what are ALL the directories I need to put there?
  2. Why on earth does the Windows find feature not show the pip* files, when I look for them using the search parameter file:pip*?
  3. Are there any other surprises I can expect?

Thanks in advance and sorry for the frustration in my question.

Asked By: Dominique

||

Answers:

Yes, you can add the python binaries to PATH manually, but there may be a simpler option. In the first screen of the installer, there is a box that says "Add Python 3.9 to PATH":
enter image description here

For some reason, this box is not checked by default. So if you want pip and other binaries to be added to path during installation, you can just check this box.

So if you want, you can uninstall python (again) and reinstall it, this time making sure that box is check. However, if you want to just add the binaries to PATH manually, this is how you could go about doing that.

First, you need to get the path to the folder containing your binaries. To do that, navigate to your python installation, find the folder with the pip binaries, select it, and click "Copy path"

enter image description here

Now the path to that folder is copied to your clipboard.

Next you need to add that path to your PATH environment variable. To do that, follow these steps:

  1. Go to start menu and type "path". Select the option that says "Edit system environment variables".

enter image description here

  1. Click "Environment Variables…"

enter image description here

  1. Scroll down and find "Path". Select it and click "Edit…"

enter image description here

  1. Click "New"

enter image description here

  1. Press Ctrl+v to paste the path you copied earlier. Hit enter.
  2. Press Ok on each of the three open dialogues.

The pip binaries should now be in your path! Note that this procedure will work for adding any folder to PATH.

Answered By: Thaddaeus Markle