ubuntu 安装 conda

ubuntu 安装 conda

ubuntu安装 conda

  • 下载地址,访问清华镜像。 windows下载 exe安装文件, linux下载 sh安装文件

https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/

  • 执行脚本
bash 复制代码
sh ./Anaconda3-5.3.1-Linux-x86_64.sh

# 如果报错:bunzip2: not found
apt-get install bzip2

# 然后一路yes
  • 刷新当前用户环境(激活环境)
bash 复制代码
source ~/.bashrc
  • 验证安装成功
bash 复制代码
conda -V
  • 添加国内镜像源
bash 复制代码
conda config --add channels <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/>
conda config --add channels <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/>
conda config --add channels <https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/>
conda config --add channels <https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/>

# 编辑文件 ~/.pip/pip.conf
cat > ~/.pip/pip.conf

# 文件内容
[global]
index-url = <https://pypi.tuna.tsinghua.edu.cn/simple>
[install]
trusted-host = <https://pypi.tuna.tsinghua.edu.cn>

# 查看已添加镜像源
conda config --get channels

# 恢复默认镜像源
conda config --remove-key channels

# ctrl + D 结束编辑

常用 conda 命令

bash 复制代码
# 创建环境
# 根据目录名添加环境到默认路径
conda create -n your_env_name python=3.8     
# 指定路径添加环境,需要管理员权限
conda create -p /opt/Anaconda/anaconda3/envs/your_env_name python=3.8     

# 查看环境列表(或者输入conda info --envs也是一样滴)
conda env list

# 删除环境
conda remove -n your_env_name --all
conda env remove -n your_env_name

# 重命名环境(将 --clone 后面的环境重命名成 -n 后面的名字)
conda create -n torch --clone py3      # 将 py3 重命名为 torch

# 创建完成环境之后,系统会提示如何 进入和退出环境,如下
conda activate your_env_name    # 进入环境
conda deactivate                # 退出环境

# 安装/删除库
conda install gatk
conda install gatk=3.7                    # 安装特定的版本:
conda install -n your_env_name gatk           # 将 gatk 安装都 指定your_env_name中
# 如果conda install慢可以考虑先进入指定环境,再用pip安装,例如如下命令
conda activate your_env_name
pip install gatk

# 搜索库
conda search gatk

# 安装完成后,可以用"which 软件名"来查看该软件安装的位置:
which gatk

# 查看已安装的库
conda list
conda list -n your_env_name      # 查看 your_env_name 下的库

# 更新指定库:
conda remove --name your_env_name gatk
相关推荐
我不要放纵5 分钟前
LVS集群搭建
linux·服务器·lvs
阿巴~阿巴~10 分钟前
自主Shell命令行解释器
linux·运维·服务器
许白掰10 分钟前
Linux入门篇学习——借助 U 盘或 TF 卡拷贝程序到开发板上
linux·学习·借助 u 盘拷贝程序到开发板上·借助 tf卡拷贝程序到开发板上
YuTaoShao2 小时前
【LeetCode 热题 100】994. 腐烂的橘子——BFS
java·linux·算法·leetcode·宽度优先
退役小学生呀2 小时前
十五、K8s可观测能力:日志收集
linux·云原生·容器·kubernetes·k8s
van叶~2 小时前
Linux探秘坊-------15.线程概念与控制
linux·运维·服务器
Andy杨4 小时前
20250718-1-Kubernetes 应用程序生命周期管理-应用部署、升级、弹性_笔记
linux·docker·容器
写写闲篇儿7 小时前
Python+MongoDB高效开发组合
linux·python·mongodb
一个龙的传说9 小时前
linux 常用命令
linux·服务器·zookeeper