pytorch安装
Pytorch安装
一、安装anaconda(...此处省略步骤..)
不是很难安装,试试就可
二、环境管理
-
这个是在Anaconda Prompt下操作的
conda create -n pytorch python=3.8
这是创建的格式
"pytorch"是这个环境变量的名字
"python=3.8"是我们要确定的当前环境的版本数
![image]()
-
No module named ’ 安装包名字’的解决方法
![image]()
已经安装完成!
- 补充:接着继续根据Could not find a version that satisfies the requirement 安装包名字 查问题:会提示换成国内的pip源 可以解决问题
-
方法一:pip install 安装包名字 -i http://pypi.doubanio.com/simple/ --trusted-host pypi.doubanio.com //豆瓣镜像网站
-
方法二:pip install 安装包名字 -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com //豆瓣
-
方法三:pip install 安装包名字 -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn //清华大学
-
还有下面几个国内pip 源,大家可以依次按照上面的方法试下
http://mirrors.aliyun.com/pypi/simple/ 阿里云
https://pypi.mirrors.ustc.edu.cn/simple/ 中国科技大学 http://pypi.mirrors.ustc.edu.cn/simple/ 中国科学技术大学
三、pycharm配置
![image]()
点击红色框按钮,添加之前conda创建的pytorch虚拟环境,在此就可以运行pytorch了





浙公网安备 33010602011771号