anaconda pycharm_安装:anaconda+cuda+pytorch+pycharm

本文整理了Anaconda、cuda+cudnn、Pytorch和Pycharm的安装方法。介绍了Anaconda的下载、安装及检测步骤,cuda+cudnn的下载、安装、验证方法和环境配置,还说明了安装镜像、Pytorch的命令及检测方式,最后给出Pycharm安装参考链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

每次安装都要在网上各种搜索,为了下次安装的时候简单一点,把对我安装帮助较大的链接整理了一下,整个过程仅供参考:

除了pycharm,其他位置均不建议更改默认位置,建议全程可开着cmd

1、anaconda安装

直接下载,然后安装, just me>>全打钩>>不学习>>完成

1.1.下载anaconda:可在官网下载https://repo.anaconda.com/archive/,也可在https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/下载

1.2.具体安装步骤:https://blog.csdn.net/u012318074/article/details/77075209

1.3检测

使用win+R,输入cmd打开命令窗口,然后输入conda,若出现一下信息则安装成功

d41282aa1081de2ae1f11c379b4982df.png

2、cuda+cudnn安装

这里配置环境变量配置的内容不依照2.1.中的,cudnn下载下来后的复制可将三个文件夹中所有内容复制粘贴

2.1.下载安装具体步骤:https://blog.csdn.net/m0_37605642/article/details/98854753

注意:在下载好cudnn后,也可以直接把三个文件夹粘贴到相应的位置下。只参照他的显卡,下载,安装,三个步骤,其他就不用啦,cudn安装主要步骤是去掉后三个√,安装的时候就明白啦

2.1.1验证cuda是否安装成功

进入cuda安装路径,如果你是默认路径,复制路径 C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.1lib

win+R,cmd打开命令窗,

输入: cd C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.1lib,回车

输入:nvcc -V,回车

若出现下图信息则安装正确

331e57d7fdb062b9ffdc91e5e043240e.png

2.1.2测试cudnn是否安装成功

进入cuda文件夹找到demo_suite,复制路径:

C:Program FilesNVIDIA GPU Computing ToolkitCUDAv11.1extrasdemo_suite

win+R,cmd打开命令窗,

输入: cd 黏贴上述路径,回车

输入:bandwidthTest.exe,回车

显示PASS则安装成功

ccad148fabe854f4b092ba3dbe7bf588.png

b01f7e6fac34e4921d4d699759feea55.png

输入:deviceQuery.exe

若显示PASS,则cuda和cudnn均安装成功

3822113af8ce582e43c76a5d146edad3.png

0a38e20819225f446f966355556af465.png

2.2.配置环境:电脑上搜编辑系统环境变量>>高级>>环境变量>>双击你要添加的位置>>进入添加页面>>新建>>浏览>>确定(具体一点的步骤在上面链接相似,粗略一点的可以参照我这个

2.2.1用户变量里面的Path添加如下样子:

8a15fc8b5197b91471573d5331202cfa.png

2.2.2系统变量里面path添加为下面的样子:

d5e65f7beab274e953de4b409a366d48.png

3.安装镜像+安装pytorch

3.1win+R输入cmd,启动cmd>>输入activate base,进入anaconda

3.2安装镜像:依次输入下列命令,没有输出结果,输就完事啦

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 --set show_channel_urls yes

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/msys2/

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/peterjc123/

3.2 安装pytorch:进入官网https://pytorch.org/,选择你的版本,习惯用conda,得到安装命令,输入cmd中(不要后面的-c pytorch,我们前面添加量清华的镜像,所以不要的会很快,不然会从官网下载,非常慢)

13257ba97aad5152ee9ad3512e5d71c0.png

3.3 检测:输入Python,回车,输入

import torch

print(torch.__version__)

没有报错就说明安装好啦,

可以把cmd关掉了

4.安装pycharm

参照:https://mp.weixin.qq.com/s/ZfbBg48o9nAwKHHDf-RXfg

感谢网络上各位大佬提供的方法,尤其是文章中链接的作者们,我只是将他们的方法稍作整理,以备以后使用,若有不足敬请原谅!!!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值