WSL版的Ubuntu 20.04 LTS用pip3安装you-get

WSL版的Ubuntu 20.04 LTS用pip3安装you-get时,显示错误:

root@xxxx:/home/xxxx# pip3 install you-get
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/you-get/
ERROR: Could not find a version that satisfies the requirement you-get (from versions: none)
ERROR: No matching distribution found for you-get

方法一:这可能是因为网络的问题,这时我们使用国内的镜像源来加速

输入命令:python -m pip install you-get (你准备安装的库名) -i pypi.douban.com/simple/ --trusted-host pypi.douban.com

pip3 install you-get -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
Looking in indexes: http://pypi.douban.com/simple/

方法二:指定镜像源

pip3 install -i pypi.tuna.tsinghua.edu.cn you-get

这时就安装成功了,会出现如下信息:

root@xxxx:/home/xxxx# pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple you-get