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
相关推荐
Christal_pyy38 分钟前
树莓派4基于Debian GNU/Linux 12 (Bookworm)添加多个静态ipv4网络
linux·网络·debian
csbDD2 小时前
2025年网络安全(黑客技术)三个月自学手册
linux·网络·python·安全·web安全
Natsuagin4 小时前
轻松美化双系统启动界面与同步时间设置(Windows + Ubuntu)
linux·windows·ubuntu·grub
我们的五年4 小时前
【Linux网络编程】应用层协议HTTP(请求方法,状态码,重定向,cookie,session)
linux·网络·http
我们的五年6 小时前
【Linux网络】TCP/IP地址的有机结合(有能力VS100%???),IP地址的介绍
linux·运维·网络·tcp/ip
davenian7 小时前
< OS 有关 > Ubuntu 24 SSH 服务器更换端口 in jp/us VPSs
linux·ubuntu·ssh
诚信爱国敬业友善7 小时前
GUI编程(window系统→Linux系统)
linux·python·gui
sekaii7 小时前
ReDistribution plan细节
linux·服务器·数据库
sun lover8 小时前
conda简单命令
python·conda
YH_DevJourney8 小时前
Linux-C/C++《C/8、系统信息与系统资源》
linux·c语言·c++