-
在清华大学开源软件镜像站(https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/)下载最新版本Anaconda3
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.3.0-Linux-x86_64.sh
-
安装Anaconda3
sudo bash Anaconda3-5.3.0-Linux-x86_64.sh
- 安装过程中可以更改安装路径,否则默认装在当前下载路径,更改路径为
/etc/anaconda3/
- 安装完后退出终端,重新连接服务器,否则不能使用conda
-
修改配置文件
/etc/profile
vim /etc/profile
在最后一行加上export PATH="$PATH:/etc/anaconda3/bin"
,如果保存时候提示readonly,输入w !sudo tee %后q!退出,再次打开文件会显示文件已修,执行source /etc/profile
-
创建新的用户组,命名为anaconda
sudo groupadd anaconda
-
把Anaconda安装的整个文件夹的组的拥有者改为步骤3中创建的组名
sudo chgrp -R anaconda /etc/anaconda3
-
修改安装的文件夹的权限
sudo chmod 770 -R /etc/anaconda3
-
把用户添加进组
sudo usermod -a -G anaconda username
,或者sudo adduser username anaconda
,之后组用户拥有安装包与创建虚拟环境的权利
-
为conda配置清华源(使用conda安装会提示solving environment…要等很久,可以在进入conda环境后,使用pip install some-package -i https://pypi.tuna.tsinghua.edu.cn/simple
安装所需要的包或者pip install some-package -i https://pypi.doubanio.com/simple/
,发现后者更快 )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/conda-forge`
Linux服务器root权限下安装Anaconda3流程
最新推荐文章于 2024-07-29 15:16:24 发布