pip install -U中的“ -U”选项代表什么

问题:pip install -U中的“ -U”选项代表什么

尽管有大量Google搜索,但我找不到pip命令行选项/参数的任何文档。什么pip install -U意思 是否有人链接到pip选项和参数列表?

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?


回答 0

键入pip install -h列出帮助:

-U,–upgrade将所有软件包升级到最新可用版本

因此,如果您已经安装了软件包,它将为您升级该软件包。如果没有-U开关,它将告诉您该软件包已安装并退出。

每个pip子命令都有其自己的帮助列表。pip -h向您显示总体帮助,并pip [subcommand] -h为该子命令提供帮助,例如install

您也可以在线找到完整的参考文档。“ 常规选项”部分涵盖了每个pip子命令可用的开关,而每个子命令都有一个单独的“ 选项”部分来涵盖特定于子命令的开关;例如,请参阅“ pip install选项”部分

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.