1、介绍
Anaconda支持Windows 、Mac OS 、Linux 操作系统。
2、下载
①下载Anaconda
进入官网,点击下载download :  自动弹出下载框,点ok :  下载比较慢,耐心稍等一下,先去忙其他事儿【A thousand year later~~~】下载完成。
②安装Anaconda
接下来的详细安装过程可以跟着这篇文章来,写得特别详细: Ubuntu18.04安装Anaconda(最新最全亲测图文并茂) 下面过程是笔者跟着该教程一步步操作的过程:
右键下载好的Anaconda3 ,选择copy ,即可复制文件路径  打开命令行,输入bash +paste粘贴文件路径 ,例如:bash '/home/vmware/Downloads/Anaconda3 - 2021.11 - Linux - x86_64.sh' ,回车Enter 。  输入Enter :  接下来一直输入Enter ,查看用户手册…… Do you accept the licence terms?[yes|no],输入yes  查看文件安装位置,输入Enter 进行安装:  安装完成。
③查看Anaconda是否安装完成
终端输入conda --version ,回车。如图,显示conda版本信息,则conda已经加入环境变量中。以后可以在命令行使用conda命令。  终端输入anaconda-navigator ,回车。有下图画面则正常启动。 
④查看python是否为Anaconda自带的
终端输入python ,回车。(可使用exit() 退出>>> ) 终端输入python3 ,回车。(可使用exit() 退出>>> ) 如果输出结果如下图所示,说明对了! 
下载步骤略,客官可参考其他博主的文章(●’?’●)
3、报错解决
Ubuntu18.04终端安装pytorch时报错
背景:笔者在安装pytorch时,发现安装报错:condaHTTPError:HTTP 000 CONNECTION FAILED for url http://…… 分析:conda安装好之后,默认的镜像是官方的。由于官网的镜像在境外,访问太慢或者不能访问,为了能够加快访问的速度,需要换源。 解决:
-
step1:在终端输入以下指令: 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/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
-
step2:找到condarc ,打开。如下图所示,找到channels下方的- defaults ,将这一行注释掉(加# )。或者直接删掉- defaults 这行也行。   -
step3:重新尝试安装pytorch,应该可以成功。
参考文献:解决CondaHTTPError: HTTP 000 CONNECTION FAILED for url
|