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
相关推荐
月光下的麦克2 小时前
win10安装conda环境
conda
Lu Zelin6 小时前
单片机为什么不能跑Linux
linux·单片机·嵌入式硬件
CS Beginner7 小时前
【Linux】 Ubuntu 开发环境极速搭建
linux·运维·ubuntu
ajassi20007 小时前
开源 C++ QT QML 开发(二)工程结构
linux·qt·qml
今天只学一颗糖8 小时前
Linux学习笔记--insmod 命令
linux·笔记·学习
摩羯座-185690305948 小时前
爬坑 10 年!京东店铺全量商品接口实战开发:从分页优化、SKU 关联到数据完整性闭环
linux·网络·数据库·windows·爬虫·python
irisart9 小时前
4.1 > Linux 文件/目录权限管理【理论】
linux
---学无止境---9 小时前
Linux中poll的实现
linux
₯㎕星空&繁华10 小时前
阿里云服务器安装MySQL服务器
服务器·ubuntu·阿里云·云计算
爱倒腾的老唐10 小时前
13、Linux 基本权限
linux·运维·服务器