问题描述:raise ReadTimeoutError(self._pool, None, ‘Read timed out.’)
ReadTimeoutError: HTTPSConnectionPool(host=‘pypi.tuna.tsinghua.edu.cn’, port=443): Read timed out.
THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the package versions, please update the hashes. Otherwise, examine the package contents carefully; someone may have tampered with them.
问题原因:网速原因,连接源时出现问题
更换pip源即可解决
国内源:
清华:https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云:https://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:https://pypi.hustunique.com/
山东理工大学:https://pypi.sdutlinux.org/
豆瓣:https://pypi.douban.com/simple/
博主亲测豆瓣源最快,根据自身情况自行选择
ubuntu进入home目录下
ctrl + h 快捷键显示隐藏文件,看是否有无 .pip文件夹,有则打开该文件夹,无则创建;
在该文件夹下,打开终端,输入以下命令创建一个pip.conf 文件
gedit pip.conf
文件内容下,以下为豆瓣源,如需其他源自行修改https://pypi.douban.com/simple/为其他源
[global]
timeout = 6000
index-url = https://pypi.douban.com/simple/
[install]
use-mirrors = true
mirrors = https://pypi.douban.com/simple/
trusted-host = pypi.douban.com
单次使用可采用以下命令
pip install -i https://pypi.douban.com/simple/ 工具包名称