Home > OS >  Change the default pip Windows
Change the default pip Windows

Time:09-20

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.

CodePudding user response:

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): enter image description here

enter image description here

  • Related