如何使用pip升级所有Python包?

时间:2010-04-27 09:23:25

标签: python pip

是否可以使用 pip 一次升级所有Python包?

注意:官方问题跟踪器上有a feature request

58 个答案:

答案 0 :(得分:1890)

还没有内置标志,但您可以使用

pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1  | xargs -n1 pip install -U

注意:这有无限的潜在变化。我试图保持这个简短而简单的答案,但请在评论中建议变化!

pip的旧版本中,您可以使用此代码:

pip freeze --local | grep -v '^\-e' | cut -d = -f 1  | xargs -n1 pip install -U

grep将跳过可编辑(“-e”)包定义,如@jawache所示。 (是的,您可以将grep + cut替换为sedawkperl或......)。

-n1的{​​{1}}标记可以防止在更新一个程序包失败时停止所有内容(感谢@andsens)。

答案 1 :(得分:589)

您可以使用以下Python代码。与pip freeze不同,这不会打印警告和FIXME错误。 对于pip< 10.0.1

import pip
from subprocess import call

packages = [dist.project_name for dist in pip.get_installed_distributions()]
call("pip install --upgrade " + ' '.join(packages), shell=True)

对于pip> = 10.0.1

import pkg_resources
from subprocess import call

packages = [dist.project_name for dist in pkg_resources.working_set]
call("pip install --upgrade " + ' '.join(packages), shell=True)

答案 2 :(得分:569)

升级所有本地包裹;你可以使用pip-review

$ pip install pip-review
$ pip-review --local --interactive

pip-reviewpip-tools的分支。请参阅pip-tools issue提到的@knedlsepppip-review包有效,但pip-tools包不再有效。

pip-review适用于Windows since version 0.5

答案 3 :(得分:239)

适用于Windows。也应该对别人有好处。 ($是您在命令提示符下的任何目录。例如C:/ Users / Username>)

DO

Transparent

打开文本文件,将==替换为> =

然后做

$ pip freeze > requirements.txt

如果某个程序包出现问题而导致升级失败(有时会出现问题),只需转到目录($),注释掉名称(在它之前添加#)并再次运行升级。您可以稍后取消注释该部分。这对于复制python全局环境也很有用。

我也喜欢pip-review方法:

$ pip install -r requirements.txt --upgrade

您可以选择' a'升级所有包裹;如果一次升级失败,请再次运行,然后继续升级。

答案 4 :(得分:105)

Rob van der Woude为FOR提供优质documentation后的Windows版

for /F "delims===" %i in ('pip freeze -l') do pip install -U %i

答案 5 :(得分:71)

您可以打印过时的软件包

pip freeze | cut -d = -f 1 | xargs -n 1 pip search | grep -B2 'LATEST:'

答案 6 :(得分:58)

以下单行可能会有所帮助:

pip list --format freeze --outdated | sed 's/(.*//g' | xargs -n1 pip install -U

如果发生错误,

xargs -n1会继续运行。

如果您需要对省略的内容以及引发错误的内容进行更细致的“细粒度”控制,则不应添加-n1标志并明确定义要忽略的错误,方法是“管道”每个单独的以下行错误:

| sed 's/^<First characters of the error>.*//'

这是一个有效的例子:

pip list --format freeze --outdated | sed 's/(.*//g' | sed 's/^<First characters of the first error>.*//' | sed 's/^<First characters of the second error>.*//' | xargs pip install -U

答案 7 :(得分:52)

这个选项在我看来更直接和可读:

pip install -U `pip list --outdated | tail -n +3 | awk '{print $1}'`

解释是pip list --outdated以这种格式输出所有过时软件包的列表:

Package   Version Latest Type 
--------- ------- ------ -----
fonttools 3.31.0  3.32.0 wheel
urllib3   1.24    1.24.1 wheel
requests  2.20.0  2.20.1 wheel

tail -n +3跳过前两行,awk '{print $1}'选择每行的第一个单词。

答案 8 :(得分:43)

使用pipupgrade

$ pip install pipupgrade
$ pipupgrade --latest --yes

pipupgrade 可帮助您从requirements.txt文件中升级系统,本地文件或软件包!它还有选择地升级不会破坏更改的软件包。 pipupgrade还确保升级存在于多个Python环境中的软件包。与Python2.7 +,Python3.4 +和pip9 +,pip10 +,pip18 +,pip19 +兼容。

enter image description here

注意:我是该工具的作者。

答案 9 :(得分:36)

这似乎更简洁。

pip list --outdated | cut -d ' ' -f1 | xargs -n1 pip install -U

说明:

pip list --outdated获取类似

的行
urllib3 (1.7.1) - Latest: 1.15.1 [wheel]
wheel (0.24.0) - Latest: 0.29.0 [wheel]

cut -d ' ' -f1-d ' '设置&#34;空格&#34;作为分隔符,-f1表示获取第一列。

所以上面的行变为:

urllib3
wheel

然后将它们传递给xargs以运行命令pip install -U,每行作为附加参数

-n1将传递给每个命令pip install -U的参数数量限制为1

答案 10 :(得分:32)

更强大的解决方案

对于pip3使用此:

pip3 freeze --local |sed -rn 's/^([^=# \t\\][^ \t=]*)=.*/echo; echo Processing \1 ...; pip3 install -U \1/p' |sh

对于pip,只需删除3s:

pip freeze --local |sed -rn 's/^([^=# \t\\][^ \t=]*)=.*/echo; echo Processing \1 ...; pip install -U \1/p' |sh

OSX Oddity

OSX,截至2017年7月,发布了一个非常旧版本的sed(十几岁)。要获得扩展的正则表达式,请在上面的解决方案中使用-E而不是-r。

解决热门解决方案的问题

这个解决方案经过精心设计和测试 1 ,而即使是最流行的解决方案也存在问题。

  • 由于更改pip命令行功能而导致的可移植性问题
  • 因为常见的pip或pip3子进程失败而导致xargs崩溃
  • 从原始xargs输出拥挤记录
  • 依赖Python-to-OS桥接,同时可能升级它 3

上面的命令使用最简单,最便携的pip语法结合sed和sh来完全克服这些问题。可以使用注释版本 2 仔细检查sed操作的详细信息。

<强>详情

[1]在Linux 4.8.16-200.fc24.x86_64集群中经过测试和定期使用,并在其他五种Linux / Unix版本上进行了测试。它还运行在Windows 10上安装的Cygwin64上。需要在iOS上进行测试。

[2]为了更清楚地看到命令的解剖结构,这与上述带有注释的pip3命令完全相同:

# match lines from pip's local package list output
# that meet the following three criteria and pass the
# package name to the replacement string in group 1.
# (a) Do not start with invalid characters
# (b) Follow the rule of no white space in the package names
# (c) Immediately follow the package name with an equal sign
sed="s/^([^=# \t\\][^ \t=]*)=.*"

# separate the output of package upgrades with a blank line
sed="$sed/echo"

# indicate what package is being processed
sed="$sed; echo Processing \1 ..."

# perform the upgrade using just the valid package name
sed="$sed; pip3 install -U \1"

# output the commands
sed="$sed/p"

# stream edit the list as above
# and pass the commands to a shell
pip3 freeze --local |sed -rn "$sed" |sh

[3]升级Python或PIP组件(也用于升级Python或PIP组件)可能会导致死锁或程序包数据库损坏。

答案 11 :(得分:28)

我在升级方面遇到了同样的问题。事实是,我永远不会升级所有包裹。我只升级了我需要的东西,因为项目可能会中断。

由于没有简单的方法来升级包,并更新requirements.txt文件,我写了pip-upgrader,其中也更新了requirements.txt文件中的版本对于所选的包(或所有包)。

<强>安装

pip install pip-upgrader

<强>用法

激活你的virtualenv(重要的是,因为它还会在当前的virtualenv中安装新版本的升级包)。

cd进入项目目录,然后运行:

pip-upgrade

高级用法

如果要求放在非标准位置,请将它们作为参数发送:

pip-upgrade path/to/requirements.txt

如果您已经知道要升级的软件包,只需将它们作为参数发送:

pip-upgrade -p django -p celery -p dateutil

如果您需要升级到发布前/发布后版本,请在命令中添加--prerelease参数。

完全披露:我写了这个包。

答案 12 :(得分:26)

来自https://github.com/cakebread/yolk

$ pip install -U `yolk -U | awk '{print $1}' | uniq`

但是你需要先得到蛋黄:

$ sudo pip install -U yolk

答案 13 :(得分:24)

@Ramana's answer的单行版本。

python -c 'import pip, subprocess; [subprocess.call("pip install -U " + d.project_name, shell=1) for d in pip.get_installed_distributions()]'

`

答案 14 :(得分:16)

使用virtualenv时,如果您只想将添加包升级到virtualenv,您可能希望这样做:

pip install `pip freeze -l | cut --fields=1 -d = -` --upgrade

答案 15 :(得分:16)

Windows Powershell解决方案

pip freeze | %{$_.split('==')[0]} | %{pip install --upgrade $_}

答案 16 :(得分:13)

我在pip issue discussion中找到的最简单,最快速的解决方案是:

sudo -H pip install pipdate
sudo -H pipdate

来源:https://github.com/pypa/pip/issues/3819

答案 17 :(得分:12)

你可以试试这个:

for i in ` pip list|awk -F ' ' '{print $1}'`;do pip install --upgrade $i;done

答案 18 :(得分:12)

相当神奇的蛋黄使这很容易。

pip install yolk3k # don't install `yolk`, see https://github.com/cakebread/yolk/issues/35
yolk --upgrade

有关yolk的更多信息:https://pypi.python.org/pypi/yolk/0.4.3

它可以做很多你可能会觉得有用的事情。

答案 19 :(得分:11)

使用awk更新包: pip install -U $(pip freeze | awk -F'[=]' '{print $1}')

windows powershell update foreach($p in $(pip freeze)){ pip install -U $p.Split("=")[0]}

答案 20 :(得分:10)

@Ramana's answer对我来说是最好的,对那些人来说,但是我不得不添加几个:

import pip
for dist in pip.get_installed_distributions():
    if 'site-packages' in dist.location:
        try:
            pip.call_subprocess(['pip', 'install', '-U', dist.key])
        except Exception, exc:
            print exc

site-packages检查会排除我的开发包,因为它们不在系统site-packages目录中。 try-except只是跳过从PyPI中删除的包。

@endolith:我也希望有一个简单的pip.install(dist.key, upgrade=True),但看起来pip似乎不会被命令行使用(文档没有提到内部API,并且pip开发人员没有使用docstrings)。

答案 21 :(得分:9)

在 Windows 或 Linux 上更新 Python 包

1-将已安装的软件包列表输出到需求文件 (requirements.txt) 中:

pip freeze > requirements.txt

2- 编辑 requirements.txt,并将所有的‘==’替换为‘>=’。使用编辑器中的“全部替换”命令。

3 - 升级所有过时的软件包

pip install -r requirements.txt --upgrade

来源:https://www.activestate.com/resources/quick-reads/how-to-update-all-python-packages/

答案 22 :(得分:9)

通过a pull-request to the pip folk发送;在此期间使用我写的这个pip库解决方案:

from pip import get_installed_distributions
from pip.commands import install

install_cmd = install.InstallCommand()

options, args = install_cmd.parse_args([package.project_name
                                        for package in
                                        get_installed_distributions()])

options.upgrade = True
install_cmd.run(options, args)  # Chuck this in a try/except and print as wanted

答案 23 :(得分:9)

这似乎对我有用......

pip install -U $(pip list --outdated|awk '{printf $1" "}')

我之后使用printf空格来正确分隔包名称。

答案 24 :(得分:6)

我的剧本:

pip list --outdated --format=legacy | cut -d ' ' -f1 | xargs -n1 pip install --upgrade

答案 25 :(得分:6)

Windows上最短,最简单。

pip freeze > requirements.txt && pip install --upgrade -r requirements.txt && rm requirements.txt

答案 26 :(得分:6)

pip_upgrade_outdated完成了这项工作。根据其docs

usage: pip_upgrade_outdated [-h] [-3 | -2 | --pip_cmd PIP_CMD]
                            [--serial | --parallel] [--dry_run] [--verbose]
                            [--version]

Upgrade outdated python packages with pip.

optional arguments:
  -h, --help         show this help message and exit
  -3                 use pip3
  -2                 use pip2
  --pip_cmd PIP_CMD  use PIP_CMD (default pip)
  --serial, -s       upgrade in serial (default)
  --parallel, -p     upgrade in parallel
  --dry_run, -n      get list, but don't upgrade
  --verbose, -v      may be specified multiple times
  --version          show program's version number and exit

第1步:

pip install pip-upgrade-outdated

第2步:

pip_upgrade_outdated

答案 27 :(得分:6)

这不是更有效吗?

pip3 list -o | grep -v -i warning | cut -f1 -d' ' | tr " " "\n" | awk '{if(NR>=3)print}' | cut -d' ' -f1 | xargs -n1 pip3 install -U 
  1. pip list -o列出过时的套餐;
  2. grep -v -i warning warning上的反向匹配,以避免更新时出现错误
  3. cut -f1 -d1' '返回第一个单词 - 过时包的名称;
  4. tr "\n|\r" " "将多行结果从cut转换为单行,以空格分隔的列表;
  5. awk '{if(NR>=3)print}'跳过标题行
  6. cut -d' ' -f1获取第一列
  7. xargs -n1 pip install -U从其左侧的管道中获取1个参数,并将其传递给命令以升级软件包列表。

答案 28 :(得分:5)

import pip
pkgs = [p.key for p in pip.get_installed_distributions()]
for pkg in pkgs:
    pip.main(['install', '--upgrade', pkg])

甚至:

import pip
commands = ['install', '--upgrade']
pkgs = commands.extend([p.key for p in pip.get_installed_distributions()])
pip.main(commands)

快速工作,因为它不是经常启动shell。我很想找到时间来实际使用过时的列表来加快速度。

答案 29 :(得分:5)

在Powershell 5.1中具有adm权限,python 3.6.5和pip ver 10.0.1的一行:

pip list -o --format json | ConvertFrom-Json | foreach {pip install $_.name -U --no-warn-script-location}

如果列表中没有破损的包装或特殊的轮子,它会平稳运行...

答案 30 :(得分:5)

这是适用于Python 3的PowerShell解决方案:

pip3 list --outdated --format=legacy | ForEach { pip3 install -U $_.split(" ")[0] }

对于Python 2:

pip2 list --outdated --format=legacy | ForEach { pip2 install -U $_.split(" ")[0] }

逐个升级软件包。所以

pip3 check
pip2 check

之后应该确保没有依赖项被破坏。

答案 31 :(得分:5)

怎么样:

pip install -r <(pip freeze) --upgrade

答案 32 :(得分:4)

以下是仅更新过期软件包的脚本。

import os, sys
from subprocess import check_output, call

file = check_output(["pip.exe",  "list", "--outdated", "--format=legacy"])
line = str(file).split()

for distro in line[::6]:
    call("pip install --upgrade " + distro, shell=True)

对于不以旧版格式输出的新版本pip(版本18 +)。

import os, sys
from subprocess import check_output, call

file = check_output(["pip.exe",  "list", "-o", "--format=json"])
line = str(file).split()

for distro in line[1::8]:
    distro = str(distro).strip('"\",')
    call("pip install --upgrade " + distro, shell=True)

答案 33 :(得分:4)

以下是我对rbp答案的修改,它绕过了“可编辑”和开发发行版。它有两个原始缺陷:它不必要地重新下载和重新安装;并且一个包上的错误将阻止在此之后升级每个包。

pip freeze |sed -ne 's/==.*//p' |xargs pip install -U --

相关的错误报告,从bitbucket迁移后有点脱节:

答案 34 :(得分:4)

查看所有过时的软件包

 pip list --outdated --format=columns

安装

 sudo pip install pipdate

然后输入

 sudo -H pipdate

答案 35 :(得分:4)

我已经尝试了Ramana的代码,我在Ubuntu上发现你必须为每个命令写sudo。这是我的脚本在ubuntu 13.10上正常工作:

#!/usr/bin/env python
import pip
from subprocess import call

for dist in pip.get_installed_distributions():
    call("sudo pip install --upgrade " + dist.project_name, shell=True)

答案 36 :(得分:4)

这是在python中使用脚本的另一种方法

import pip, tempfile, contextlib

with tempfile.TemporaryFile('w+') as temp:
    with contextlib.redirect_stdout(temp):
        pip.main(['list','-o'])
    temp.seek(0)
    for line in temp:
        pk = line.split()[0]
        print('--> updating',pk,'<--')
        pip.main(['install','-U',pk])

答案 37 :(得分:4)

我最近一直在使用pur。这很简单,也很重要。它会更新您的requirements.txt文件以反映升级,然后您可以像往常一样使用requirements.txt文件进行升级。

$ pip install pur
...
Successfully installed pur-4.0.1

$ pur
Updated boto3: 1.4.2 -> 1.4.4
Updated Django: 1.10.4 -> 1.10.5
Updated django-bootstrap3: 7.1.0 -> 8.1.0
All requirements up-to-date.

$ pip install --upgrade -r requirements.txt
Successfully installed Django-1.10.5 ...

答案 38 :(得分:3)

如果您使用的是Linux或macOS:

pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1
pip3 install -U

如果您使用的是Windows(PowerShell):

pip freeze | %{$_.split('==')[0]} | %{pip install --upgrade $_}

答案 39 :(得分:2)

import os
import pip
from subprocess import call, check_call

pip_check_list = ['pip', 'pip3']
pip_list = []
FNULL = open(os.devnull, 'w')


for s_pip in pip_check_list:
    try:
        check_call([s_pip, '-h'], stdout=FNULL)
        pip_list.append(s_pip)
    except FileNotFoundError:
        pass


for dist in pip.get_installed_distributions():
    for pip in pip_list:
        call("{0} install --upgrade ".format(pip) + dist.project_name, shell=True)

我拿了@Ramana's answer并使pip3友好。

答案 40 :(得分:2)

以下是通过pip更新所有python3软件包(在激活的virtualenv中)的代码:

import pkg_resources
from subprocess import call

for dist in pkg_resources.working_set:
    call("python3 -m pip install --upgrade " + dist.project_name, shell=True)

答案 41 :(得分:2)

下面的Windows cmd代码段执行以下操作:

  
      
  • pip升级到最新版本。
  •   
  • 升级所有过时的软件包。
  •   
  • 对于每个要升级的软件包,请检查requirements.txt是否有任何版本说明符。
  •   
@echo off
Setlocal EnableDelayedExpansion
rem https://stackoverflow.com/questions/2720014

echo Upgrading pip...
python -m pip install --upgrade pip
echo.

echo Upgrading packages...
set upgrade_count=0
pip list --outdated > pip-upgrade-outdated.txt
for /F "skip=2 tokens=1,3 delims= " %%i in (pip-upgrade-outdated.txt) do (
    echo ^>%%i
    set package=%%i
    set latest=%%j
    set requirements=!package!

    rem for each outdated package check for any version requirements:
    for /F %%r in (.\python\requirements.txt) do (
        call :substr "%%r" !package! _substr
        rem check if a given line refers to a package we are about to upgrade:
        if "%%r" NEQ !_substr! (
            rem check if the line contains more than just a package name:
            if "%%r" NEQ "!package!" (
                rem set requirements to the contents of the line:
                echo requirements: %%r, latest: !latest!
                set requirements=%%r
            )
        )
    )
    pip install --upgrade !requirements!
    set /a "upgrade_count+=1"
    echo.
)

if !upgrade_count!==0 (
    echo All packages are up to date.
) else (
    type pip-upgrade-outdated.txt
)

if "%1" neq "-silent" (
    echo.
    set /p temp="> Press Enter to exit..."
)
exit /b


:substr
rem string substition done in a separate subroutine -
rem allows expand both variables in the substring syntax.
rem replaces str_search with an empty string.
rem returns the result in the 3rd parameter, passed by reference from the caller.
set str_source=%1
set str_search=%2
set str_result=!str_source:%str_search%=!
set "%~3=!str_result!"
rem echo !str_source!, !str_search!, !str_result!
exit /b

答案 42 :(得分:2)

以下是我的变体:

pip list --outdated --format=legacy | awk '{print $1;}' | xargs -n1 pip install -U

答案 43 :(得分:2)

纯bash / zsh oneliner可以做到这一点:

for p in $(pip list -o --format freeze); do pip install -U ${p%%=*}; done

或者,以格式精美的方式:

for p in $(pip list -o --format freeze)
do
    pip install -U ${p%%=*}
done

答案 44 :(得分:2)

cmd中的一行:

for /F "delims= " %i in ('pip list --outdated --format=legacy') do pip install -U %i

所以

pip check

之后应该确保没有依赖项被破坏。

答案 45 :(得分:2)

这里的另一个答案是:

pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U

是一种可能的解决方案, 这里的一些评论(包括我自己)在使用此命令时遇到了权限问题。对以下内容进行了一些改动,解决了这些问题。

pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 sudo -H pip install -U

注意添加的sudo -H允许命令以root权限进行朗读。

答案 46 :(得分:1)

pip list -o | cut -d' ' -f1 | xargs -n1 pip install -U 2> /dev/null

如果你有2个不同版本的python,并且你只想升级所有python3的包,那么只需输入pip3而不是pip

2> /dev/null用于摆脱所有恼人的错误消息

答案 47 :(得分:1)

要升级默认 python 版本中的所有 pip 默认包,只需在终端或命令提示符中运行底部 python 代码:

import subprocess
import re


pkg_list = subprocess.getoutput('pip freeze')

pkg_list = pkg_list.split('\n')


new_pkg = []
for i in pkg_list:
    re.findall(r"^(.*)==.*", str(i))
    new = re.findall(r"^(.*)==.*", str(i))[0]
    new_pkg.append(new)

for i in new_pkg:
    print(subprocess.getoutput('pip install '+str(i)+' --upgrade'))

答案 48 :(得分:1)

我能找到的最短最容易的事情:

pip install -U $(pip freeze | cut -d"=" -f1)

$(cmd)键允许您包装任何shell命令行(它返回其输出)。

答案 49 :(得分:0)

更新所有已安装软件包的快速方法可能是:

{{1}}

答案 50 :(得分:0)

python -c 'import pip; [pip.main(["install", "--upgrade", d.project_name]) for d in pip.get_installed_distributions()]'

一个班轮!

答案 51 :(得分:0)

如果你想升级只是由pip安装打包,并且为了避免升级由其他工具(如apt,yum等)安装的软件包,那么你可以使用我在我的Ubuntu上使用的这个脚本(也许也适用于其他发行版) - 基于this post

    public class StaticFinalExample {
  /*
   * Static final fields should be initialized either in
   * static blocks or at the time of declaration only
   * Reason : They variables are like the utility fields which should be accessible
   * before object creation only once.
   */
  static final int x;

  /*
   * Final variables shuould be initialized either at the time of declaration or
   * in initialization block or constructor only as they are not accessible in static block
   */
  final int y;

  /*
   * Static variables can be initialized either at the time of declaration or
   * in initialization or constructor or static block. Since the default value is given to the
   * static variables by compiler, so it depends on when you need the value
   * depending on that you can initialize the variable appropriately
   * An example of this is shown below in the main method
   */
  static int z;

  static {
    x = 20; // Correct
  }
  {
    y = 40; // Correct
  }
  StaticFinalExample() {
    z = 50; // Correct
  }
  public static void main (String args[]) {
    System.out.println("Before Initialization in Constructor" + z);   // It will print 0
    System.out.println("After Initializtion in Constructor" + new StaticFinalExample().z); // It will print 50
  }
}

答案 52 :(得分:0)

只需为记录添加JSON + JQ答案:

pip list -o --format json | jq '.[] | .name' | xargs pip install -U

答案 53 :(得分:0)

即使在conda env中也能运行的最佳解决方案是:

pip freeze --local | grep -v '^\-e' | cut -d = -f 1 |cut -d ':' -f 2 | xargs -n1 pip install -U

答案 54 :(得分:0)

  1. 首先安装jq(mac):

    $ brew install jq

  2. 2

    $pip3 install --upgrade  `pip3 list --outdated --format json | jq '.[] | .name' | awk -F'"' '{print $2}'`
    

答案 55 :(得分:0)

用于蝙蝠脚本

call pip freeze > requirements.txt
call powershell "(Get-Content requirements.txt) | ForEach-Object { $_ -replace '==', '>=' } | Set-Content requirements.txt"
call pip install -r requirements.txt --upgrade

答案 56 :(得分:0)

TLDR:以下工作原理

pip install -U $(pip freeze)

答案 57 :(得分:-1)

pip list | awk -F ' ' '{print $1}' | xargs -l pip install --upgrade   
相关问题