主要参考:(11条消息) Anaconda下的pytorch环境配置_LEiJx27的博客-CSDN博客_anaconda配置pytorch环境
anaconda添加环境变量
D:\Anaconda(Python需要)
D:\Anaconda\Scripts(conda自带脚本)
D:\Anaconda\Library\mingw-w64\bin(使用C with python的时D:\Anaconda\Library\bin(jupyter notebook动态库)
创建虚拟环境:
conda create -n <env name> python=3.7
-n写成-name创建出来环境名直接是ame,吓坏我
安装pytorch:
conda install pytorch torchvision torchaudio cpuonly -c pytorch
安装失败,报错如下

原因好像是官网源下载太慢超时,用清华源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro/
然后直接
conda install pytorch
安装pyG:
可恶啊不支持windows pytorch1.13.*,只好再安装pytorch1.12
Note:后面发现我后来的环境安的竟然是pytorch1.11
上面的方法好像只能下最新的,所以直接把要安装的包下到本地,然后
conda install --offline .\cudnn-7.0.5-cuda8.0_0.tar.bz2 (具体下载路径)
jupyter notebook——命令行打开
需要到iypnb文件所在位置,再输入命令,将用默认浏览器打开
cd /d D:\
jupyter notebook
安装matplotlib:
conda install matplotlib
开了vpn会安装失败,得关了
安装tensorboardX:
安装tensorboard还是得先安装tensorflow
conda install tensorflow==1.14
tensorboardX需要1.15以上的tensorboard(不指定版本默认安装1.14的)
pip install tensorboard==1.15
出错:
tensorflow 1.14.0 requires google-pasta>=0.1.6, which is not installed.
tensorflow 1.14.0 requires tensorboard<1.15.0,>=1.14.0, but you have tensorboard 1.15.0 which is incompatible.
又重新安了tensorflow 1.15
pip install tensorboardX
安装 scikit-dsp-comm :
参考:Scikit Dsp Comm :: Anaconda.org
conda install -c conda-forge scikit-dsp-comm
在shell里乱搞
conda init