一、创建环境
conda create -n pytorch python=3.6
创建成功
![创建成功](https://img-blog.csdnimg.cn/direct/ecad9570bafc473eb8f1c11a5d9d0084.png)
二、进入虚拟环境
conda activate pytorch
括号中base变为pytorch
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/382be8bd21ec4f1d87c8765daf44f99d.png)
查看虚拟环境中有哪些包
pip list
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/e057628f95804c1f84dd6ad6d6ceec67.png)
三、安装pytorch
1.官网复制安装指令
pytorch官网
conda install pytorch torchvision torchaudio cpuonly -c pytorch
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/4f77d17d341043be9a2e7191f55af077.png)
查看是否列表中是否已安装pytorch
pip list
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/d365b39a9a9a4c57ac580b73f5a95d06.png)
2.验证pytorch
进入python环境
python
import torch
若未报错,即为安装成功