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
相关推荐
2401_8582861112 分钟前
OS15.【Linux】gdb调试器的简单使用
linux·运维·服务器·开发语言·gdb
行止63 小时前
OpenStack云平台管理
linux·openstack
岁岁岁平安3 小时前
CentOS-7-x86_64解决:使用NAT模式无法ping通www.baidu.com或无法ping 8.8.8.8问题。
linux·运维·centos·centos-7
运维小贺4 小时前
各服务器厂商调整BIOS睿频教程
linux·运维·服务器·性能优化
特种加菲猫4 小时前
指尖上的魔法:优雅高效的Linux命令手册
linux·笔记
★Orange★4 小时前
Linux Kernel kfifo 实现和巧妙设计
linux·运维·算法
bemyrunningdog5 小时前
Mock数据
linux·运维·ubuntu
是阿建吖!5 小时前
【Linux | 网络】网络编程套接字
linux·网络
退役小学生呀5 小时前
十、K8s集群资源合理化分配
linux·云原生·容器·kubernetes·k8s
Winner13006 小时前
Debian、Buildroot 和 Ubuntu 都是基于 Linux 的系统区别
linux·ubuntu·debian