Despite a ton of Googling, I can't find any docs for pip's command line options/arguments. What does pip install -U
mean? Does anyone have a link to a list of pip's options and arguments?
Asked
Active
Viewed 1.1e+01k times
250

user2441511
- 11,036
- 3
- 25
- 50

zakdances
- 22,285
- 32
- 102
- 173
1 Answers
292
Type pip install -h
to list help:
-U, --upgrade Upgrade all packages to the newest available version
So, if you already have a package installed, it will upgrade the package for you. Without the -U switch it'll tell you the package is already installed and exit.
Each pip
subcommand has its own help listing. pip -h
shows you overall help, and pip [subcommand] -h
gives you help for that sub command, such as install
.
You can also find the full reference documentation online; the General Options section covers switches available for every pip
subcommand, while each subcommand has a separate Options section to cover subcommand-specific switches; see the pip install
options section, for example.

Martijn Pieters
- 1,048,767
- 296
- 4,058
- 3,343
-
So to upgrade all packages is it no longer neccesary to run something like: `import pip from subprocess import call for dist in pip.get_installed_distributions(): call("pip install --upgrade " + dist.project_name, shell=True)` – zakdances Sep 15 '12 at 06:54
-
1@yourfriendzak: Use `pip freeze --local | cut -d = -f 1 | xargs pip install -U` to upgrade *all* your packages. – Martijn Pieters Sep 15 '12 at 06:57
-
@user2357112: I actually find the online documentation the be unhelpful in this case, so I don’t think it deserves the prominence you gave it here. – Martijn Pieters May 13 '18 at 09:05