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

相关推荐
激动的兔子1 小时前
关于Anaconda的使用心得pkgs.trash清理
conda
Yolanda_202220 小时前
在vscode终端中可使用pip,但是cmd终端中找不到命令 pip问题的解决
vscode·python·conda·pip
2301_809815251 天前
Git和Gitee基本使用教程
git·gitee
雨翼轻尘1 天前
01_Git概述及基本操作
git·概述·基本操作
程序员果子1 天前
CrewAI :当 Agent 学会团队协作
人工智能·git·python·多智能体·agent框架
‎ദ്ദിᵔ.˛.ᵔ₎1 天前
Git GDB/CGDB调试器
git·gdb
接针1 天前
Pycharm远程连接Ubuntu的conda环境
ubuntu·pycharm·conda
他们都叫我GPT侠1 天前
【无标题】
git·github
果汁华1 天前
CLI 命令行与 Python 框架实战
git·python·github
zzzzzz3101 天前
我用 AI Agent 重构了日常开发工作流,效果出乎意料
人工智能·git·github