简体   繁体   中英

How to change Python path from using MINGW64's path to original windows path in Windows 11

I have installed the latest version of Python (3.10.5) and I tried writing some code and found that some of the modules are not working while running. When I tried to check the version through powershell or cmd it shows that

Python 3.9.13 (main, May 19 2022, 07:22:26) [GCC 11.3.0 64 bit (AMD64)] on win32

Then I realized that it is using the MINGW64's python compiler I tried to change the environmental variables but thought I would not mess with it. I want to change the path to the original Windows path.

I had the same problem with you. I already installed Python 3.10.5 but when I check the python version with python --version , it was still in version 3.9.7.

What I did is add the default path of the python in the "Edit Enviroment variable". Add the following path:

  • C:\Users<User>\AppData\Local\Programs\Python\Python310\Scripts
  • C:\Users<User>\AppData\Local\Programs\Python\Python310

And then bring the 2 path above the mingw64 path so that it will have a higher priority. Check again in terminal if this time your python version is correct. If it's still show previous version, you might want to close your cmd and reopen them again.

I hope this helps.

Cheers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM