简体   繁体   中英

Change the default pip Windows

When I run pip show pip on Powershell, it returns me: c:\users\thomas\anaconda3\lib\site-packages

and when I run python -m pip show pip , it returns me: c:\python310\lib\site-packages

I would like to know if there is a way to replace the default current pip to the one when I run python -m pip show pip without using aliases and virtual environement.

I tried to write a pip.ini file with:

[global]
target = c:\python310\lib\site-packages

but it hasn't change anything.

pip or python are executables on your computer and when you run the pip or the python command Windows uses environment variables to invoke software. You need to modify your environment variables (paths) to change the pip or the python version.

  • pip ( pip show pip ): somewhere_on_your_computer\Python\Python310\Scripts

  • python ( python -m pip show pip ): somewhere_on_your_computer\Python\Python310

My setup (In the list the order is important): 在此处输入图像描述

在此处输入图像描述

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