拿到一个空的服务器,安装anaconda,下载虚拟的python环境,方便炼丹
一、常用命令,先更新一下系统软件,清理一下无用的垃圾
sudo apt update
sudo apt list --upgradable
sudo apt upgrade
sudo apt-get clean && sudo apt-get autoclean
二、进入anaconda的官网,下载对应的版本
https://repo.anaconda.com/archive/
我一般不喜欢下载最新版本,可能遇到一些未知的问题
Anaconda3-2023.03-1-Linux-x86_64.sh
用wget下载就行
wget https://repo.anaconda.com/archive/Anaconda3-2023.03-1-Linux-x86_64.sh
三、 给脚本执行权限
chmod +x Anaconda3-2023.03-1-Linux-x86_64.sh
然后执行
./Anaconda3-2023.03-1-Linux-x86_64.sh
我的建议是环境安装在根目录就行了
四、 初始化环境,启用环境
source ~/.bashrc
安装成功,可以添加清华镜像,这样下载包的时候更快
五、配置清华镜像
#添加镜像源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
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/r
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
#显示检索路径
conda config --set show_channel_urls yes
#显示镜像通道
conda config --show channels
大功告成!