Skip to content

Instantly share code, notes, and snippets.

@steven2358
Last active April 28, 2021 08:43
Embed
What would you like to do?

Conda environment commandos

https://conda.io/docs/index.html

Create environment

conda create --name my_environment python=3
activate my_environment

To find necessary packages for a given script:

python my_file.py

For each necessary package we can first search, e.g.

conda search autograd

And then install them, e.g.

conda install autograd
conda install matplotlib
conda install brewer2mpl
conda install pandas
conda install tqdm
conda install scikit-learn
conda install spyder
conda install GPy
pip install GPyOpt

Export the environment file

conda env export > environment.yml

Create environment from file

conda env create -f my_environment.yml

This loads environment from yaml configuration file.

Activate environment

activate my_environment

Deactivate environment

deactivate

Remove environment

conda remove --name my_environment --all

Update environment from YML file

source activate myenv
conda env update -f=local.yml

List all environments

conda env list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment