win10系统anaconda中cpu版pytorch安装,使用spyder编译器(不需要配置虚拟环境)

 

win10系统anaconda中cpu版pytorch安装,使用spyder编译器

一.在官网上下载anaconda安装包,以python3.7为例

win10系统anaconda中cpu版pytorch安装,使用spyder编译器(不需要配置虚拟环境)

安装时注意事项:

  1. 安装路径中不要出现中文和空格,推荐装在C盘

win10系统anaconda中cpu版pytorch安装,使用spyder编译器(不需要配置虚拟环境)

  1. 两个都勾选

勾第二个的时候会出现下图,点击确定

win10系统anaconda中cpu版pytorch安装,使用spyder编译器(不需要配置虚拟环境)win10系统anaconda中cpu版pytorch安装,使用spyder编译器(不需要配置虚拟环境)

 

二.在pytorch官网下载whl文件

win10系统anaconda中cpu版pytorch安装,使用spyder编译器(不需要配置虚拟环境)win10系统anaconda中cpu版pytorch安装,使用spyder编译器(不需要配置虚拟环境)

 

win10系统anaconda中cpu版pytorch安装,使用spyder编译器(不需要配置虚拟环境)win10系统anaconda中cpu版pytorch安装,使用spyder编译器(不需要配置虚拟环境)

下载CP37的版本,torch和torchvision版本自选

 

三.打开Anaconda Powershell Prompt

把第二步下载的whl文件放在下图划线的文件夹下,一般是C:\Users\Username,然后pip install torch-1.1.0-cp37-cp37m-win_amd64.whl

pip install pip install torchvision-0.5.0+cpu-cp37-cp37m-win_amd64.whl

win10系统anaconda中cpu版pytorch安装,使用spyder编译器(不需要配置虚拟环境)

 

 

四.检查是否安装成功

输入python

import torch

print("hello torch {}".format(torch.__version__))

win10系统anaconda中cpu版pytorch安装,使用spyder编译器(不需要配置虚拟环境)

 

打开spyder,在console中import torch

不报错即安装成功

win10系统anaconda中cpu版pytorch安装,使用spyder编译器(不需要配置虚拟环境)