This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: User specific paths added to System PATH environment variable
Type: behavior Stage:
Components: Installation, Windows Versions: Python 3.10
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: akrymskiy, eryksun, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2022-01-02 17:13 by akrymskiy, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
py_paths.png akrymskiy, 2022-01-02 17:13 My environment variables
py_install_options.png akrymskiy, 2022-01-08 00:56
Messages (6)
msg409507 - (view) Author: Aleksandr Krymskiy (akrymskiy) Date: 2022-01-02 17:13
Installed Python 3.10.1 using Windows 64-bit installer from python.org. Upon examining the PATH environment variables I noticed that my local user paths (C:\Users\avk\AppData\...) have been added to the System-level PATH variable instead of User level, which can cause problems on multi-user systems, since users other than mine will now have these paths in their environment causing them to potentially try to execute code from unexpected location that they should not even have access too. User paths should be added to User specific PATH environment variable and only global (C:\Program Files\Python310\...) kept in the System scope by the installer. Please see my screenshot - the highlighted should be moved to User scoped PATH var.
msg409594 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2022-01-03 16:05
If you have them, can you share your install logs (look in %TEMP% for files starting with "Python"). If not, please share your install options.

By default, this works fine. You have to make some specific modifications to the install options to do what you've done, such as choosing to install for all users and then overriding the install path to a per-user location. If you're installing just for yourself, the installer shouldn't even have the permissions required to modify system-wide environment variables.

It's also possible that your machine has a special configuration to do this, in which case you'll need to speak with your administrator to find out why. We can't help with that - we just use standard MSIs and let the OS choose where things go.
msg410065 - (view) Author: Aleksandr Krymskiy (akrymskiy) Date: 2022-01-08 00:56
I did not find install logs in my user %TEMP% or C:\Windows\Temp. I did select "install for all users" during setup just like I always do, but I did not override the default location of "C:\Program Files\Python310". I attached screenshots of the options selected during setup.
msg410070 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2022-01-08 01:51
Were you upgrading an existing installation of Python 3.10? Did it actually install in "C:\Program Files\Python310"? Is Python currently installed in per-user "%LocalAppData%\Programs\Python\Python310"? Was it ever installed there?
msg410249 - (view) Author: Aleksandr Krymskiy (akrymskiy) Date: 2022-01-10 19:50
I installed 3.10, and then removed 3.9 that I had installed previously. Python is installed in "C:\Program Files\Python310". The only thing that exists under %LocalAppData% is an empty directory "C:\Users\avk\AppData\Local\Programs\Python\Python310\Scripts" - I always install "for all users" so there isn't anything else under the "C:\Users\avk\AppData\Local\Programs\Python" other than the empty directory I mentioned.
msg410251 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2022-01-10 20:03
Without logs or the ability to reproduce it, there's not much we can do. I ran the install and it put the variables in the right place, so it's not happening all the time.

The install logs are usually detailed enough to see why decisions like this are made, but it'll almost certainly be because of something specific to your machine. If running the install again produces the same result, those logs will be helpful as well. I don't see us being able to make any product changes for this though.
History
Date User Action Args
2022-04-11 14:59:54adminsetgithub: 90384
2022-01-10 20:03:03steve.dowersetmessages: + msg410251
2022-01-10 19:50:27akrymskiysetmessages: + msg410249
2022-01-08 01:51:15eryksunsetnosy: + eryksun
messages: + msg410070
2022-01-08 00:56:33akrymskiysetfiles: + py_install_options.png

messages: + msg410065
2022-01-03 16:05:22steve.dowersetmessages: + msg409594
2022-01-02 20:44:59ned.deilysetnosy: + paul.moore, tim.golden, steve.dower, zach.ware
components: + Windows
2022-01-02 17:13:08akrymskiycreate