系统自带的pip版本为:pip 9.0.1 导致ansible无法升级到2.10
找了很多办法进行升级pip3,apt upgrade python3-pip,pip3 install --upgrade setuptools pip都已失败告终。
最终一条命令解决了
办法
$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ python3 get-pip.py
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://repo.huaweicloud.com/repository/pypi/simple
Collecting pip
Downloading https://repo.huaweicloud.com/repository/pypi/packages/1f/2c/d9626f045e7b49a6225c6b09257861f24da78f4e5f23af2ddbdf852c99b8/pip-22.2.2-py3-none-any.whl (2.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 15.5 MB/s eta 0:00:00
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
Successfully uninstalled pip-9.0.1
$ pip3 -V
pip 22.2.2