Anaconda Cheat Sheet

Anaconda is a popular open-source distribution of the Python and R programming languages. It is designed to simplify the process of data science and machine learning by providing a comprehensive set of tools and libraries for data analysis, visualization, and modeling. Anaconda is widely used by data scientists, researchers, and developers to build and deploy data-driven applications.

One of the key features of Anaconda is its package management system, which allows users to easily install, update, and manage hundreds of data science packages and libraries. Anaconda also includes a powerful integrated development environment (IDE) called Spyder, which provides a user-friendly interface for writing, testing, and debugging Python and R code.

This cheat sheet provides an overview of some of the most commonly used commands and features in Anaconda.

Installation

CommandDescription
conda install package_nameInstall a package
conda update package_nameUpdate a package
conda remove package_nameRemove a package
conda create --name env_nameCreate a new environment
conda activate env_nameActivate an environment
conda deactivateDeactivate the current environment
conda infoDisplay information about the current installation
conda listList all installed packages

Environments

CommandDescription
conda create --name env_nameCreate a new environment
conda activate env_nameActivate an environment
conda deactivateDeactivate the current environment
conda env listList all environments
conda env export > environment.ymlExport an environment to a YAML file
conda env create -f environment.ymlCreate an environment from a YAML file

Packages

CommandDescription
conda install package_nameInstall a package
conda update package_nameUpdate a package
conda remove package_nameRemove a package
conda search package_nameSearch for a package
conda listList all installed packages
conda list --explicit > packages.txtExport a list of installed packages to a text file
conda install --file packages.txtInstall packages from a text file

Channels

CommandDescription
conda config --add channels channel_nameAdd a new channel
conda config --remove channels channel_nameRemove a channel
conda config --show channelsShow all channels
conda install -c channel_name package_nameInstall a package from a specific channel

Jupyter Notebook

CommandDescription
jupyter notebookStart the Jupyter Notebook server
jupyter notebook --notebook-dir=path/to/notebooksStart the Jupyter Notebook server with a specific directory
jupyter notebook --port=8888Start the Jupyter Notebook server on a specific port
jupyter notebook --no-browserStart the Jupyter Notebook server without opening a browser
jupyter notebook listList all running Jupyter Notebook servers
jupyter nbconvert --to=pdf notebook.ipynbConvert a notebook to PDF format
jupyter nbconvert --to=html notebook.ipynbConvert a notebook to HTML format

Conda Forge

CommandDescription
conda install -c conda-forge package_nameInstall a package from the Conda Forge channel
conda config --add channels conda-forgeAdd the Conda Forge channel
conda config --remove channels conda-forgeRemove the Conda Forge channel
conda search -c conda-forge package_nameSearch for a package in the Conda Forge channel

Conclusion

This cheat sheet provides an overview of some of the most commonly used commands and features in Anaconda. With this information, you should be able to get started with Anaconda and begin exploring the world of data science and machine learning.

Reference:

https://docs.anaconda.com/