python:pip升级pip本身和setuptools(Python 3.7.15)
一,升级pip3自身:
查看pip当前版本:
[root@blog bin]# pip3 -V pip 22.0.4 from /usr/local/soft/python3.7.15/lib/python3.7/site-packages/pip (python 3.7)
升级pip
[root@blog bin]# python3 -m pip install --upgrade pip
升级后查看pip当前版本:
[root@blog bin]# pip3 -V pip 22.3 from /usr/local/soft/python3.7.15/lib/python3.7/site-packages/pip (python 3.7)
说明:刘宏缔的架构森林是一个专注架构的博客,
网站:https://blog.imgtouch.com
本文: https://blog.imgtouch.com/index.php/2023/06/03/python-pip-sheng-ji-pip-ben-shen-he-setuptools-python-3-7-15/
对应的源码可以访问这里获取: https://github.com/liuhongdi/
或: https://gitee.com/liuhongdi
说明:作者:刘宏缔 邮箱: 371125307@qq.com
二,升级setuptools
查看setuptools升级前的版本:
[root@blog DeOldify]# python3 -m pip show setuptools Name: setuptools Version: 47.1.0 Summary: Easily download, build, install, upgrade, and uninstall Python packages Home-page: https://github.com/pypa/setuptools Author: Python Packaging Authority Author-email: distutils-sig@python.org License: UNKNOWN Location: /usr/local/soft/python3.7.15/lib/python3.7/site-packages Requires: Required-by:
升级setuptools
[root@blog DeOldify]# pip3 install --upgrade setuptools Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/ Requirement already satisfied: setuptools in /usr/local/soft/python3.7.15/lib/python3.7/site-packages (47.1.0) Collecting setuptools Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/41/82/7f54bbfe5c247a8c9f78d8d1d7c051847bcb78843c397
b866dba335c1e88/setuptools-65.5.0-py3-none-any.whl (1.2 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 19.1 MB/s eta 0:00:00 Installing collected packages: setuptools Attempting uninstall: setuptools Found existing installation: setuptools 47.1.0 Uninstalling setuptools-47.1.0: Successfully uninstalled setuptools-47.1.0 Successfully installed setuptools-65.5.0 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager.
It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
查看setuptools升级后的版本
[root@blog DeOldify]# python3 -m pip show setuptools Name: setuptools Version: 65.5.0 Summary: Easily download, build, install, upgrade, and uninstall Python packages Home-page: https://github.com/pypa/setuptools Author: Python Packaging Authority Author-email: distutils-sig@python.org License: Location: /usr/local/soft/python3.7.15/lib/python3.7/site-packages Requires: Required-by:
三,查看python的版本:
[lhdop@blog ~]$ python3 --version Python 3.7.15