close

How to change pip installation path

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about How to change pip installation path in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

Table of Contents

How to change pip installation path?

  1. How to change pip installation path?

    You can tell pip where to install the package. Use the -t flag , that means the target directory where you want to install the package. Have have look at pip install --help

  2. change pip installation path

    You can tell pip where to install the package. Use the -t flag , that means the target directory where you want to install the package. Have have look at pip install --help

Method 1

You can tell pip where to install the package. Use the -t flag , that means the target directory where you want to install the package. Have have look at pip install --help

-t, --target <dir>        Install packages into <dir>. By default this will not replace existing
                          files/folders in <dir>. Use --upgrade to replace existing packages in <dir> with
                          new versions.

You can change this on permanent basis by changing the pip.ini configuration file. See this for detail: pip install path

On Unix and Mac OS X the configuration file is:

$HOME/.pip/pip.conf

On Windows, the configuration file is: %HOME%\pip\pip.ini The %HOME% is located in

 C:\Users\Bob on windows assuming your name is Bob

You may have to create the pip.ini file when you find your pip directory. Within your pip.ini or pip.config you will then need to put (assuming your on windows) something like

[global]
target=C:\Users\<username>\Desktop

Method 2

On macOS go to /usr/local/bin/.

Remove the link to pip:

rm /usr/local/bin/pip

Create the new link pointing to the new installation:

sudo ln -s /new path /usr/local/bin/pip

Summery

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read