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

相关推荐
像风一样的男人@7 分钟前
warning: could not find UI helper ‘git-credential-manager-ui‘
git·ui
代钦塔拉2 小时前
Git & GitHub 从入门到精通:全流程实战教程
git·github
晚风吹红霞3 小时前
Linux下的趣味编程 —— 进度条、Git版本控制与GDB调试实战
linux·运维·git
xlq223223 小时前
7.git
git
Ws_3 小时前
Git + Gerrit 第六课:commit --amend、Patch Set 与 Change-Id
git
AIMath~20 小时前
向github中上传文件过大超过50M怎么办
网络·git·github
AIMath~1 天前
如何将一个新的文件夹使用git 工具提交到github新仓库中
git·github
满天星83035771 天前
【Git】原理及使用(二) (版本回退)
linux·git
愿天垂怜1 天前
【C++脚手架】ffmpeg 库的介绍与使用
linux·服务器·开发语言·c++·ide·git·ffmpeg
月夜的风吹雨1 天前
Linux 基础开发工具详解:从 yum 到 gdb 实战指南
linux·git·ubuntu·centos·vim