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

相关推荐
rit84324998 小时前
Git常用命令的详细指南
大数据·git·elasticsearch
我要升天!9 小时前
Git的原理与使用 -- 分支管理
大数据·git·elasticsearch
聪明努力的积极向上9 小时前
【GIT】VS中图形化页面进行还原和重置的git操作
git
Hermia_yuan11 小时前
【Git】版本更新
git
inx17719 小时前
为什么要用Git?如何使用Git?
git
Empty_7771 天前
Keepalived双机热备
linux·git·github
课堂随想1 天前
vscode关闭自动激活conda环境
vscode·conda
ityangs1 天前
GitLab 私服(基于 Docker)搭建方案
git·docker·容器·gitlab
人工智能训练2 天前
在 Ubuntu 系统中利用 conda 创建虚拟环境安装 sglang 大模型引擎的完整步骤、版本查看方法、启动指令及验证方式
linux·运维·服务器·人工智能·ubuntu·conda·sglang
ZYMFZ2 天前
Redis主从复制与哨兵集群
前端·git·github