Anaconda Tools And Component Introduction

Anaconda is an open-source Python distribution that supports Linux, MAC, and Windows. It contains more than 180 science packages and their dependencies, such as Python core, Conda, Numpy, Pandas, and Matplotlib. This will stop you from fail installing a library because of the lack of dependencies. Because it contains a large number of science packages, Anaconda’s download file is also large (several hundred MB). If you only need some of them, or need to save bandwidth or storage space, you can also use miniconda, a smaller distribution (only including conda and python).

1. Anaconda Component Introduction.

Once anaconda is installed, it will provide us the following executable programs.

1.1 Anaconda Navigator.

A general control dashboard to configure all aspects of Anaconda. It contains several useful applications.

anaconda navigator

1.2 Anaconda Prompt.

Command line console, easy to execute some commands in anaconda environment.

anaconda prompt

1.3 Jupyter Notebook

A powerful interactive web-based environment.

jupyter notebook

1.4 Spyder.

An integrated environment ide similar to pycham.

anaconda spyder

1.5 Conda.

Like the pip package management tool of python, Anaconda also comes with a package management tool which is named conda, it has its own package repository and server. Conda is a dedicated open source package and environment management tool for Anaconda. It provide below functions.

1.5.1 Environment Management.
  1. Create a new environment : conda create -n env_name list of packages.
    # Create a new environment, the environment name is py3, contains python 3.7, pandas package.
    conda create -n py3 python=3.7 pandas
    
    # Clone an exist environment.
    conda create --name new_env --clone old_env
  2. Enter the environment by name.
    # Linux, Mac
    source activate env_name
    
    # Windows
    activate env_name
    
  3. Exit the environment.
    # Linux, Mac
    source deactivate
    
    # Windows
    deactivate
  4. Remove environment.
    conda env remove -n env_name
  5. List all conda environment.
    conda env list
  6. View environment information.
    conda info --envs
  7. Save current environment package information into a yaml file.
    conda env export --name env_name > environment.yaml
  8. Load conda environment from a yaml file.
    conda env create -f environment.yaml
1.5.2 Packages Management.

You can use conda to install, update, and uninstall packages, and it focuses more on data science related packages. Conda does not only manage Python packages, it can also install none Python packages. For example, in the new version of anaconda, R-language integrated development environment Rstudio can be installed. Below is some common usage of conda.

  1. Confirm conda is installed.
    conda --version
  2. Update conda version.
    conda update conda
  3. Query conda information.
    conda info
  4. Upgrade anaconda.
    conda update anaconda
  5. Install package.
    conda install package_name
  6. Install multiple packages at the same time.
    conda install pkg_1 pkg_2 pkg3 ... ( ie: conda install numpy scipy pandas
  7. Install the specified version.
    conda install numpy=1.10
  8. Remove package.
    conda remove package_name
  9. Update package.
    conda update package_name
  10. Update all packages.
    conda update --all
  11. List all installed packages.
    conda list
  12. Query a package, or fuzzy query.
    conda search search_key_word