Managing Environments with Miniconda


The previous article explains how to properly install and configure Miniconda. This article will explain how to manage your environments.

Creating a Virtual Environment

conda create -n <myenv> python=<3.7> pip -y

This command will create a virtual environment with the following properties:

Activating a Virtual Environment

conda activate <myenv>

Deactivating a Virtual Environment

conda deactivate <myenv>

Listing Available Environments

conda env list

Removing an Environment

conda remove --name <myenv> --all

Cloning an Environment

conda create --name <myclone> --clone <myenv>

Removing PS1 Prompt

conda config --set changeps1 false

To re-enable:

conda config --set changeps1 true

Searching for packages

conda search <package-name>

Sharing an environment

conda env export > environment.yml
conda env create -f environment.yml

Installing Packages & Pinning Versions

conda install <package>=<version-number>
pip install <package>==<version-number>