git clone 和 conda 换源

文章目录

  • [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 文件。

相关推荐
饼干ovo3 小时前
shell编程
java·git·github
bubiyoushang88810 小时前
解决 Git 访问 GitHub 时的 SSL 错误
git·github·ssl
海码00714 小时前
【版本控制】Git 和 GitHub 入门教程
git·github
网硕互联的小客服17 小时前
503 Service Unavailable:服务器暂时无法处理请求,可能是超载或维护中如何处理?
服务器·git·github
abcnull19 小时前
github开源协议选择
git·github·开源协议
安庆平.Я21 小时前
git互联GitHub 使用教程
git·github
自来也_1 天前
Git配置代理
git
弱冠少年2 天前
conda入门
conda
John Song2 天前
conda指定包安装的channel
conda
Jooolin2 天前
【编程史】Git是如何诞生的?这可并非计划之中...
linux·git·ai编程