linuxanaconda更换清华源
时间: 2023-04-26 10:05:38 浏览: 119
1. 打开终端,输入以下命令:
```
sudo sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Base.repo
sudo sed -i 's/#baseurl/baseurl/g' /etc/yum.repos.d/CentOS-Base.repo
sudo sed -i 's|http://mirror.centos.org|https://mirrors.tuna.tsinghua.edu.cn|g' /etc/yum.repos.d/CentOS-Base.repo
```
2. 修改完成后,输入以下命令更新yum缓存:
```
sudo yum clean all
sudo yum makecache
```
3. 安装anaconda,输入以下命令:
```
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2021.05-Linux-x86_64.sh
bash Anaconda3-2021.05-Linux-x86_64.sh
```
4. 安装完成后,输入以下命令激活环境:
```
source ~/.bashrc
```
5. 输入以下命令验证是否更换成功:
```
conda config --show channels
```
如果输出结果中包含了清华源,说明更换成功。
相关问题
Anaconda更换清华源、
安装Anaconda和添加环境变量的具体步骤。
要更换Anaconda的下载源为清华源,可以按照以下步骤进行操作:
1. 打开终端并执行以下命令,查看当前Anaconda的默认下载源是否已经是清华源:
```
conda config --show
```
如果清华源已经是默认下载源,则可以跳过此步骤。
2. 执行以下命令,将Anaconda的下载源更换为清华源:
```
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 --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/fastai/
conda config --append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --append channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
conda config --set show_channel_urls yes
```
3. 安装完成后,重新打开一个新的终端窗口,并执行以下命令,确认Anaconda已经成功安装:
```
conda info
```
关于Anaconda的安装过程,可以按照以下步骤进行操作:
1. 首先,在终端中下载Anaconda的安装包。你可以选择从Anaconda官网或者清华镜像下载。建议使用清华镜像下载,速度会更快。请根据你的系统选择合适的版本进行下载。在本教程中,我们以Anaconda3-5.3.1-Linux-x86_64.sh为例。
2. 下载完成后,打开终端并进入安装包所在目录。执行以下命令来安装Anaconda:
```
bash Anaconda3-5.3.1-Linux-x86_64.sh
```
3. 在安装过程中,你需要查看并接受许可协议。请按照提示,在终端中按下回车键以继续安装。
4. 安装完成后,你可以选择是否将Anaconda添加到环境变量中。如果你想在终端中使用Anaconda的命令和工具,输入`yes`并按下回车键。如果你不希望添加到环境变量中,输入`no`并按下回车键。
5. 最后,重新打开一个新的终端窗口,并执行以下命令,确认Anaconda已经成功安装:
```
conda info
```
通过以上步骤,你将能够成功更换Anaconda的下载源为清华源,并且安装Anaconda并在环境变量中添加它。
anaconda更换清华源、中科大源 星尘
anaconda是一个常用的Python开发环境,使用anaconda可以方便地管理Python及其依赖包。在使用anaconda时,我们需要从特定的源中下载软件包和依赖项。为了加快下载速度,一些用户选择更换清华源或中科大源。
更换清华源和中科大源都需要做两步:
第一步,找到conda的配置文件.condarc,并打开它。在Windows上该文件通常存在于C:\Users\Username\.condarc,而在Linux和Mac上则存在于~/.condarc。
第二步,在.condarc文件中加入如下内容:
清华源:
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
中科大源:
channels:
- https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
- https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
- https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
- https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
加入以上内容之后,可以在anaconda中使用conda命令下载软件包和依赖项,安装速度将大大提高。
综上所述,更换清华源或中科大源可以优化anaconda下载速度,加快Python及其依赖包的安装。但需要注意,选择源时要选择文件完整性验签,以确保安全性。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)