基础是base环境
conda create -n pytorch python=3.6
切换成pytorch环境
conda activate pytorch
安装Windows环境pytorch11.6版本(其他版本命令可前往pytorch官网查看https://pytorch.org/)
conda install pytorch torchvision torchaudio cudatoolkit=11.6 -c pytorch -c conda-forge
安装pytorch时,询问是否需要安装相关包,输入y
使用pip list可查看当前已安装包的情况
pip list
查看pytorch是否安装成功
如果不报错,就表示安装成功
可以切换国内镜像源安装,临时使用一次
pip install six -i https://pypi.douban.com/simple/
一劳永逸方法
pip config set global.index-url https://pypi.douban.com/simple/