如何升級 pip

emanlee發表於2024-09-20

[root@VM-8-12-centos ~]# which pip3
/usr/bin/pip3
[root@VM-8-12-centos ~]# pip3 -V
pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)

[root@VM-8-12-centos ~]# pip3 install --upgrade pip
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting pip
Downloading http://mirrors.tencentyun.com/pypi/packages/a4/6d/6463d49a933f547439d6b5b98b46af8742cc03ae83543e4d7688c2420f8b/pip-21.3.1-py3-none-any.whl (1.7MB)
100% |████████████████████████████████| 1.7MB 69.6MB/s
Installing collected packages: pip
Successfully installed pip-21.3.1
You are using pip version 21.3.1, however version 24.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[root@VM-8-12-centos ~]# pip3 -V
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
pip 21.3.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)

[root@VM-8-12-centos ~]# which pip3
/usr/local/bin/pip3
/usr/bin/pip3

[root@VM-8-12-centos ~]# ll /usr/bin/pip3
-rwxr-xr-x 1 root root 407 Oct 14 2020 /usr/bin/pip3
[root@VM-8-12-centos ~]# ll /usr/local/bin/pip3
-rwxr-xr-x 1 root root 225 Aug 30 11:20 /usr/local/bin/pip3

相關文章