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
venvsorconda envssolves this problem) Program Filesis 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.
Answer from TrakJohnson on Stack OverflowI just got a new Windows laptop (we have to use Windows at my job). For all my prior laptops, I wound up with a confusing mishmash of the Windows store Python (or stub), several other versions, various path issues and (my fault) various issues with global packages vs. user installed packages vs. virtual environments.
If you were starting over with a new Windows laptop what approach would you use? Just python.org and venv? Should I use uv? Maybe I should use wsl2 instead of native Windows? Or run within Docker containers?
I'd like to get off to a strong start.
What path to install Python 3.6 to on Windows? - Stack Overflow
What's the simplest way to get Python on a Windows PC?
Installing Python
Install python on Windows WITHOUT using the official installer?
Can I install multiple Python versions on Windows?
Do I need administrator rights to install Python on Windows?
How do I confirm Python is correctly added to my Windows PATH?
Videos
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
venvsorconda envssolves this problem) Program Filesis 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.