【yolo系列:小白建立环境报错.ReadTimeoutError: HTTPSConnectionPool(host=‘download.pytorch.org‘, port=443): Read】

建立了yolo的环境,使用pip命令报错

pip install torch==1.12.0+cu113 torchvision==0.13.0+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu113

下载一半停止了报错
在这里插入图片描述
错误提示表明在尝试从PyTorch的下载服务器下载软件包时出现了超时错误。可以选择使用清华源。

pip install torch==1.12.0+cu113 torchvision==0.13.0+cu113 -i https://pypi.tuna.tsinghua.edu.cn/simple

如果换源没有用,可能有两个原因:
第一个是因为下载安装的位置不允许有中文路径,这个比较好解决,只需要使用cd命令退出到不含中文路径的地方即可。
使用

cd  ../

返回上级目录
在这里插入图片描述
第二个原因是因为,缺少numpy的库,需要先安装这个numpy,才能再安装这个。
如果上面是win+r的管理员
可以使用pip安装。在命令行中运行以下命令:

pip install numpy

使用conda安装(使用Anaconda):
在命令行中运行以下命令:

conda install numpy

使用国内镜像源,可以在命令中使用以下语法:
对于conda

conda install numpy -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/

对于pip:

pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple

这将会使用清华大学的镜像源下载NumPy。
然后继续执行你的pip install torch的命令

pip install torch==1.12.0+cu113 torchvision==0.13.0+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu113

猜你喜欢

转载自blog.csdn.net/weixin_47869094/article/details/132252945