Anaconda

"There's a devil inside everyone."

Posted by Ruby on August 14, 2021

Anaconda

check version

When you log in to an Ubuntu system for the first time, before doing any work it is always a good idea to check what version of Ubuntu is running on the machine. what I really need:

hostnamectl
 Static hostname: ubuntu
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 7ec60286722d41848f03e024d13c84bc
           Boot ID: 50940574f5094fcd948aee8532dce843
    Virtualization: vmware
  Operating System: Ubuntu 18.04.2 LTS
            Kernel: Linux 4.18.0-15-generic
      Architecture: x86-64

更新系统

Anaconda 安装

现在conda国内镜像都已停用,我是为了更方便的多版本管理继续使用的。因为其他多版本管理的工具我看不懂

  1. 下载
  2. 验证MD5
    md5sum ./Anaconda3-2019.03-Linux-x86_64.sh
    43caea3d726779843f130a7fb2d380a2
    

    hashes

  3. 安装
    bash ./Anaconda3-2019.03-Linux-x86_64.sh
    

We recommend you accept the default install location.

source ~/.bashrc

To run conda from anywhere without having the base environment activated by default, use conda config –set auto_activate_base False.

  1. check naviagtor
    anaconda-navigator
    

image.png-259.6kB

conda directory structure

which anaconda
/home/song_adm/anaconda2/bin/anaconda

更改权限 但是在更新过程中发现服务器的conda实际在

/usr/local/anaconda3
  • ROOT_DIR The directory that Anaconda or Miniconda was installed into. EXAMPLES: /opt/Anaconda #Linux

    • /pkgs Also referred to as PKGS_DIR. This directory contains decompressed packages, ready to be linked in conda environments. Each package resides in a subdirectory corresponding to its canonical name.
    • /envs The system location for additional conda environments to be created. The following subdirectories comprise the default Anaconda environment:
    • /bin
    • /include
    • /lib
    • /share

Other conda environments usually contain the same subdirectories as the default environment.

channels

官方doc conda-forge bioconda defaults 清华镜像

查看channels:

conda config --show

更新

conda update -n base conda

jupyter notebook

  • leave for yourself

加入r环境 当前工作环境

conda install -c r r-essentials
#用这个
conda create -n r_env r-essentials r-base

Jupyter 还有可以让你在同一个代码框,同时写python代码和R代码的方法

conda environment

A conda environment is a directory that contains a specific collection of conda packages that you have installed. For example, you may have one environment with NumPy 1.7 and its dependencies, and another environment with NumPy 1.6 for legacy testing. If you change one environment, your other environments are not affected. You can easily activate or deactivate environments, which is how you switch between them. You can also share your environment with someone by giving them a copy of your environment.yaml file.