文章目录
- [git clone 通过 ssh](#git clone 通过 ssh)
- [conda 创建虚拟环境通过 env.yml 文件](#conda 创建虚拟环境通过 env.yml 文件)
- [conda 换源](#conda 换源)
git clone 通过 ssh
c
git clone ssh://用户名@IP地址:/仓库名字.git
conda 创建虚拟环境通过 env.yml 文件
c
conda env create -f environment.yml
conda 换源
Step 1
生成 .bashrc 文件在家目录下。执行:
cpp
conda config --set show_channel_urls yes
结果:

Step 2
更换清华源。执行:
c
vim ~/.condarc
添加如下内容,然后保存退出。
c
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
- defaults
结果:

Step 3
验证换源是否成功。执行:
c
conda config --show-sources
结果:

成功。
Extra step
清除国内源,执行:
c
conda config --remove-key channels
这将清空 .condarc 文件。