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
相关推荐
wdfk_prog8 小时前
[Linux]学习笔记系列 -- [drivers][input]input
linux·笔记·学习
盟接之桥8 小时前
盟接之桥说制造:引流品 × 利润品,全球电商平台高效产品组合策略(供讨论)
大数据·linux·服务器·网络·人工智能·制造
忆~遂愿8 小时前
ops-cv 算子库深度解析:面向视觉任务的硬件优化与数据布局(NCHW/NHWC)策略
java·大数据·linux·人工智能
湘-枫叶情缘8 小时前
1990:种下那棵不落叶的树-第6集 圆明园的对话
linux·系统架构
Fcy6489 小时前
Linux下 进程(一)(冯诺依曼体系、操作系统、进程基本概念与基本操作)
linux·运维·服务器·进程
袁袁袁袁满9 小时前
Linux怎么查看最新下载的文件
linux·运维·服务器
代码游侠10 小时前
学习笔记——设备树基础
linux·运维·开发语言·单片机·算法
Gary Studio10 小时前
rk芯片驱动编写
linux·学习
mango_mangojuice10 小时前
Linux学习笔记(make/Makefile)1.23
java·linux·前端·笔记·学习
Harvey90310 小时前
通过 Helm 部署 Nginx 应用的完整标准化步骤
linux·运维·nginx·k8s