Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the -t flag for pip?

Tags:

python

pip

I was advised to use pip install module-name -t /path/to/project-dir, but I did not understand what the t flag is for. Can someone help me?

like image 225
Thiago Krempser Avatar asked Jan 29 '18 14:01

Thiago Krempser


People also ask

What does the flag do in pip install?

The --user flag to pip install tells Pip to install packages in some specific directories within your home directory. This is a good way to have your own default Python environment that adds to the packages within your system directories, and therefore, does not affect the system Python installation.

What is the U flag in pip?

Install the latest version of a package: Once you have identified the outdated packages using the pip list -o command, use the following command to install the latest version of the package. -U flag stands for update.

How do you check for pip?

To check if PIP is already installed on Windows, we should open the command line again, type pip , and press Enter . If PIP is installed, we will receive a long notification explaining the program usage, all the available commands and options.

What is pip list few of them?

The pip list command returns the list of packages in the current environment. It also returns the installed version for each package. Packages are listed in a case-insensitive sorted order. pip list returns a list of all packages.


2 Answers

From the manual:

-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.
like image 174
plaes Avatar answered Sep 21 '22 07:09

plaes


At the time of writing, OP has 4 thumbs down because the question was worded in granular manner not indicative of the real problem, paraphrased below:

"Why does the --help option not display all possible flags that the pip command supports, and their usages?"

Answer: More are covered in the manual page link that user:plaes provided, such as "-r" for requirements.

like image 29
Jordan Stefanelli Avatar answered Sep 17 '22 07:09

Jordan Stefanelli