How to move python system env variable to top of Path list ?


vmars316

Member
Local time
4:42 PM
Posts
17
OS
win 11
Thanks for your Help…

How to move python sys env variable to top of Path list ?
Internet suggests click the Move Up button .
But there is no Move Up button .
Surely there is an app to do this ?
win 11 my env-variables list has no "Move Up" button .What to do ?
Is there a freeware to do this , PowerToys & Winaero show no "Move Up" button either .
System-Environmental-Variables.png
 

My Computer

System One

  • OS
    win 11
    Computer type
    Laptop
    Manufacturer/Model
    LG
    Memory
    32gb
There is no need to move a variable up or down in the list, because variables are not interpreted in some specific order.

What is the actual problem you're trying to solve?
 

My Computer

System One

  • OS
    Windows 11 Pro 24H2 [rev. 4349]
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Intel Core i7-1260P, 2100 MHz
    Motherboard
    NUC12WSBi7
    Memory
    64 GB
    Graphics Card(s)
    Intel Iris Xe
    Sound Card
    built-in Realtek HD audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840x2160 @ 60Hz
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Keyboard
    CODE 104-Key Mechanical with Cherry MX Clears
    Antivirus
    Microsoft Defender
  • Like
Reactions: OAT
"What is the actual problem you're trying to solve?"

How can I get a Move Up button like other win 11 systems have .
 

My Computer

System One

  • OS
    win 11
    Computer type
    Laptop
    Manufacturer/Model
    LG
    Memory
    32gb
The Move Up / Move Down feature is reserved for Editing the Path and PSModulePath variables, and no other variables.

1731390059660.png

To modify your "System Python312 Scripts" path, you have to carefully edit it or copy/paste it from somewhere else.
I don't believe you can change System variables to allow the same editing for custom environment variables.
 
Last edited:

My Computer

System One

  • OS
    Windows 7
After some testing, it's possible to use the Move Up / Down buttons if your variable is defined in the Registry as REG_EXPAND_SZ instead of REG_SZ.

Which means your app has to create the variable using a reg command, instead of using the normal SET command from a CMD script.
Code:
reg add HKEY_CURRENT_USER\ENVIRONMENT /v "System Python312 Scripts" /t REG_EXPAND_SZ /d C:\;D:\ /f

1731392910101.png
 

My Computer

System One

  • OS
    Windows 7
Thanks garlin ,
I ran this :
reg add HKEY_CURRENT_USER\ENVIRONMENT /v "System Python312 Scripts" /t REG_EXPAND_SZ /d C:\;D:\ /f
and it completed .
Then Restart ed .
But still no : Move Up / Move Down button .
 

My Computer

System One

  • OS
    win 11
    Computer type
    Laptop
    Manufacturer/Model
    LG
    Memory
    32gb
There is no need to move a variable up or down in the list, because variables are not interpreted in some specific order.

What is the actual problem you're trying to solve?
I have run into problems when running Python ,
because "C:\Users\vmars\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\Scripts"
is not on TOP of the list .
 

My Computer

System One

  • OS
    win 11
    Computer type
    Laptop
    Manufacturer/Model
    LG
    Memory
    32gb
If I remember correctly, Python uses an environment variable called PYTHONPATH. Try making a new user variable with that name, and set it to that Scripts folder path you mentioned in the post above. User variables are created in that same dialog box in your screen shot, just at the top of the window.
 

My Computer

System One

  • OS
    Windows 11 Pro 24H2 [rev. 4349]
    Computer type
    PC/Desktop
    Manufacturer/Model
    Intel NUC12WSHi7
    CPU
    12th Gen Intel Core i7-1260P, 2100 MHz
    Motherboard
    NUC12WSBi7
    Memory
    64 GB
    Graphics Card(s)
    Intel Iris Xe
    Sound Card
    built-in Realtek HD audio
    Monitor(s) Displays
    Dell U3219Q
    Screen Resolution
    3840x2160 @ 60Hz
    Hard Drives
    Samsung SSD 990 PRO 1TB
    Keyboard
    CODE 104-Key Mechanical with Cherry MX Clears
    Antivirus
    Microsoft Defender
The default install location for Python is in AppData. However, I put it in a different location. Namely, I have Python 3.1.3 installed in"
C:\Programs\Python\Python313

I don't use the PYTHONPATH Environment Variable. I have my own paths defined which seem to work OK for me.

Understanding the Python Path Environment Variable in Python

It is not necessary to edit the environment variables using regedit. You can access it in Settings

Open Settings
Go to System > About
Select Advanced system settings

p1-jpg.116115


p2.jpg

In Advanced tab select Environmental Variables

p3.jpg

In User variables select Path
Select Edit
I have the Python Path variables defined there

p4.jpg

The Python Scripts path leads to:

p5.jpg

I use Thonny to edit my Python programs. I used to install the standalone Thonny app which doesn't always include the latest release of Python. Now I first install Python by itself. Then from within the Scripts folder at the command line I use PIP to install the Thonny app.
 

Attachments

  • p1.jpg
    p1.jpg
    86.5 KB · Views: 2
Last edited:

My Computers

System One System Two

  • OS
    Windows 11 Pro 24H2
    Computer type
    Laptop
    Manufacturer/Model
    ASUS TUF Gaming A15 (2022)
    CPU
    AMD Ryzen 7 6800H with Radeon 680M GPU (486MB RAM)
    Memory
    Crucial DDR5-4800 (2400MHz) 32GB (2 x 16GB)
    Graphics Card(s)
    NVIDIA RTX 3060 Laptop (6GB RAM)
    Sound Card
    n/a
    Monitor(s) Displays
    15.6-inch
    Screen Resolution
    1920x1080 300Hz
    Hard Drives
    2 x Samsung 990 Evo Plus (2TB M.2 NVME SSD)
    PSU
    n/a
    Mouse
    Wireless Mouse M510
    Internet Speed
    2000Mbps/300Mbps
    Browser
    Firefox
    Antivirus
    Malwarebytes
  • Operating System
    Windows 11 Pro 24H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom build
    CPU
    AMD Ryzen 7 5700X3D
    Motherboard
    ASUS ROG Strix B550-F Gaming WiFi II
    Memory
    G.SKILL Flare X 32GB (2x16GB) DDR4
    Graphics card(s)
    ASUS ROG-STRIX-RTX3060TI-08G-V2-GAMING (RTX 3060-Ti, 8GB RAM)
    Monitor(s) Displays
    Samsung G50D IPS 27"
    Screen Resolution
    1440p/180Hz
    Hard Drives
    2TB XPG SX8200 Pro (M2. PCIe SSD) || 2TB Intel 660P (M2. PCIe SSD)
    PSU
    Corsair RM750x (750 watts)
    Case
    Cooler Master MasterCase 5
    Cooling
    Scythe Mugen 6
    Keyboard
    Logitech K520 (MK540 keyboard/mouse combo)
    Mouse
    Logitech M310 (MK540 keyboard/mouse combo)
    Internet Speed
    2000 Mbps down / 300 Mbps up
    Browser
    Firefox, Edge, Chrome
    Antivirus
    Malwarebytes (Premium)
    Other Info
    ASUS Blu-ray Burner BW-16D1HT (SATA) || Western Digital Easystore 20TB USB 3.0 external hard drive used with Acronis True Image 2025 backup software || HP OfficeJet Pro 6975 Printer/Scanner

Latest Support Threads

Back
Top Bottom