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

相关推荐
胡耀超44 分钟前
4、Python面向对象编程与模块化设计
开发语言·python·ai·大模型·conda·anaconda
1373i5 小时前
【Python】pytorch安装(使用conda)
pytorch·python·conda
小毛驴8509 小时前
所有微服务部署都使用一个git地址,并且通过docker部署各个服务的情况下,如何编写mvn指令来处理各个服务。
git·docker·微服务
国王不在家10 小时前
git 切换仓库后清理分支缓存
git
柯南二号13 小时前
【Gitlab】Ubuntu 20.04服务器部署Gitlab
git·gitlab
phac12314 小时前
git 如何直接拉去远程仓库的内容且忽略本地与远端不一致的commit
大数据·git·elasticsearch
~|Bernard|1 天前
在 PyCharm 里怎么“点鼠标”完成指令同样的运行操作
算法·conda
ficker131 天前
git常用命令
git
您的通讯录好友1 天前
conda环境导出
linux·windows·conda
kevin_cat1 天前
微信群机器人-备份文件发送通知
git·bash·企业微信