Linux下在自己的用户环境中安装Python(Ubuntu)

您所在的位置:网站首页 Ubuntu下载Python Linux下在自己的用户环境中安装Python(Ubuntu)

Linux下在自己的用户环境中安装Python(Ubuntu)

2023-08-18 21:44| 来源: 网络整理| 查看: 265

pip国内镜像源设置

由于默认的pip镜像源是国外的,想要更快的下载建议换成国内的镜像

cd ~ #回到用户的家目录 mkdir .pip #创建隐藏文件夹 vim .pip/pip.config #创建配置文件,并且添加以下内容 [global] index-url=https://mirrors.aliyun.com/pypi/simple/ extra-index-url= https://pypi.tuna.tsinghua.edu.cn/simple/ https://pypi.mirrors.ustc.edu.cn/simple/ https://pypi.douban.com/simple/ [install] trusted-host=mirrors.aliyun.com

在这里插入图片描述 在这里插入图片描述

至此设置完毕!

PyTorch下载

关于安装pytorch(cuda版),我选择的是cuda11.3,如果安装过程中中断了,可能是网络波动,重新再下载试试 在这里插入图片描述

pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

在这里插入图片描述



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3