What path to install Python 3.6 to on Windows? What path to install Python 3.6 to on Windows? python python

What path to install Python 3.6 to on Windows?


This is a very subjective question in most cases, I'm not really sure if its even fit for SO.

Here are the different characteristics of each path:

C:\PythonXY:

  • Requires administrator rights
  • All users have access to it - better if you want only one install of a python version on your system
  • More practical to write in command line (might be needed for multiple python installs, although using venvs or conda envs solves this problem)
  • Program Files is the same, except that there are spaces in the path (probably a bad idea)

AppData:

  • Doesn't require administrator rights
  • Only for one user - good if the other users don't want/need it
  • Might be painful to write in command line

I have admin rights and am the only user on my computer, so I chose the first option, but it really is case-dependent.

EDIT Please see the comments below for rectifications on paths.


Installing Python in c:\Program Files\ in 64-bit Windows 10 has problems because of the new "security features" of Windows 10. Subfolders of c:\Programs Files\ have restricted permissions on them which are not compatible with the installation processes for some Python packages. Installing in a directory directly below the root (for example c:\Python36\ for Python 3.6) avoids these problems. It may be "less secure", but it actually works, which installing under c:\Program Files\ sometimes does not. For example, I have found that if you try to install the matplotlib package in Python 3.7 installed under c:\Program Files\, some of the packages that matplotlib is dependent on are blocked from installing, and the package will not run, but if it is installed in c:\Python37\, it runs fine. Another example of overly enthusiastic Microsoft "security."

Installing in the %appdata% folder for a single user is fine if you are the only person who is going to be using Python, but if your computer is going to be used by another user (for example, if it is a work computer which will be "inherited" by a new employee that takes over your position), Python (and all necessary Python packages) would have to be reinstalled for that user.


I think the best path to install python is in C:\Users\<Username>\PythonXX (especially if you are using PC with multiple users and also if you are using your organization PC.

If you install to C:\PythonXX or to C:\Program Files\PythonXX, you will always have permissions issue. As soon as you try to install some packages/libraries using 'pip install ', permissions will not allow to install the packages.

If you leave the installation to be continued in C:\Users\<Username>\AppData\Local\Programs\Python\PythonXX as suggested by python installer, which also doesn't have any permissions issue, but path is not so easy to remember.

Few more important points:

  1. If you are using a personal laptop and you are the only user (you will be administrator as well), then installing python to C:\PythonXX is also a best option.
  2. Always check the option, add python path to Path variable during installation, so that you can also use python from command prompt/powershell.
  3. Always check the option, install pip, so that you can use pip to install/update packages/libraries.