WARNING: You are using pip version 19.2.3, however version 22.2.2 is available问题解决
一、问题现象:
在编译VPP执行make install-ext-deps时报错缺失meson源码:
ls: cannot access /root/vpp/vpp/build/external/downloads/meson*: No such file or directory
Looking in links: /root/Downloads
Downloading https://files.pythonhosted.org/packages/44/05/8ac9e7747e5cdf817c2916cc15980374ef04cb2ecf4f6818392928c61923/meson-0.55.0.tar.gz (1.7MB)
|鈻堚枅鈻堚枊 | 194kB 5.6kB/s eta 0:04:38ERROR: Exception:
…
socket.timeout: The read operation timed out
下载源码超时,最终误导报错就是:
WARNING: You are using pip version 19.2.3, however version 22.2.2 is available.
You should consider upgrading via the ‘pip install –upgrade pip’ command.
二、问题原因:
出现这种情况实际是因为国外的网站访问限速,所以会一直报错timeout,可以用参数延长timeout也可以换源。
网上有很多按提示信息升级PIP的操作,但是没什么用,比如:
python3 -m pip install -U pip
或者
python3 -m pip install pip==22.2.2
Centos可以执行升级:
pip3 install –upgrade pip
升级操作的网站很慢访问下载一样会超时,即使你升级成功了,有限速的网站超时 还是会出现的错误还是以上的提示;
[root@localhost ~]# pip –version
pip 22.2.2 from /usr/local/lib/python3.8/site-packages/pip (python 3.8)
WARNING: You are using pip version 19.2.3, however version 22.2.2 is available.
You should consider upgrading via the ‘pip install –upgrade pip’ command.
三、修改方法:
外国的网站下面慢,那就换国内的,总的思路就是替换下载源:
1、如果是下载源码压缩文件类的修改:
修改 ~/.pip/pip.conf (没有就创建一个), 修改 index-url至tuna清华源,操作及内容如下:
mkdir ~/.pip/
cd ~/.pip/
[root@localhost .pip]# pwd
/root/.pip
vi pip.conf
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
修改效果对比:
国外源下载很慢,一般就是几K速率,最终都会超时;
国内源下载很快,一般都是几百K速率,速率提升50~100倍,最终下载成功。
2、如果是安装可执行程序类的修改,直接执行安装:
pip3 install --index-url https://pypi.douban.com/simple xxxx
或者
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple xxxx
从清华镜像获取库。
常见pip下载镜像还有:
阿里:https://mirrors.aliyun.com/pypi/simple
中国科学技术大学:https://pypi.mirrors.ustc.edu.cn/simple