Anaconda Cheat Sheet

Getting Started

This is the instructions on how to use anaconda from scratch.

Installing Anaconda

There are different versions for different OS Go to this link: https://docs.anaconda.com/anaconda/install/

Conda info

conda info 

To create Create an environment variable:

conda create --name <myenv> 

define python version

conda create -n <myenv> python=3.7

define specific package

conda create -n myenv matplotlib

with all anaconda packages

conda create -n myenv anaconda

import from yml file

conda env create -f test.yml

Clone an environment variable:

conda create --name myclone --clone myenv

Remove environment variable:

Specific packages

conda remove --name <myenv> <package_name>
conda remove --name <myenv> --all

Export environment variable to yml file:

conda env export --file myenv.yml

List all packages in the environment:

conda list

List all environment in anaconda:

conda env list

To activate an environment:

conda activate <myenv>

Use jupyter notebook from the environment:

conda activate <myenv>
jupyter-notebook

Installing packages

Install packages in the current environment

conda install <packagename>

Install packages in the different environment

conda install --name <myenv> <packagename>

Search package to install:

conda search <packagename>

Alternatively you search online for the commands to install packages

Update packages:

Specific packages

conda update <package_name> <package_name2> ... 

ALl packages

conda update -all 

Show current python version

python -version