pip安装【Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) 】

pip安装osmnx包时出现:

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', OSError(0, 'Error'))': /simple/osmnx/
ERROR: Could not find a version that satisfies the requirement osmnx (from versions: none)

一般遇到 ERROR: Could not find a version that satisfies the requirement osmnx (from versions: none)

通常是两种情况:

1.pip的等级不够,需要升级

python -m pip install --upgrade pip

2.没有使用镜像源

pip install XXX -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

但是不完全是,比如我在安装pytorch(GPU)版本的时候,用了各种镜像源还是出现:

可能是因为网络不稳定吧,所以我就去pytorch的官网手动的下载wheel文件(PyTorch)

pip安装【Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) 】_第1张图片

如上图,在文件保存的路径下输入cmd命令 ,然后输入以下命令,安装好torch之后继续安装torchvision

pip install torch-1.8.0+cu111-cp38-cp38-win_amd64.whl
pip install torchvision-0.9.0+cu111-cp38-cp38-win_amd64.whl

最后torch的gpu版本就可以用啦pip安装【Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) 】_第2张图片

另外还有一种常见的代理警告

 出现这种情况,一般是因为谷歌或者火狐浏览器开了代理设置,关闭即可。具体操作如下:

pip安装【Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) 】_第3张图片

关闭代理即可!

你可能感兴趣的:(python)