Skip to content

Instantly share code, notes, and snippets.

@mrdbourke
Last active October 5, 2019 04:35
Show Gist options
  • Save mrdbourke/1a5012b75a150c9340497aca615e66d1 to your computer and use it in GitHub Desktop.
Save mrdbourke/1a5012b75a150c9340497aca615e66d1 to your computer and use it in GitHub Desktop.
A list of helpful conda commands (markdown form)
Function Command
Get a list of all your environments conda env list
Get a list of all the packages installed in your current active environment conda list
Create an environment called [ENV_NAME] conda create --name [ENV_NAME]
Create an environment called [ENV_NAME] and install pandas and numpy conda create --name [ENV_NAME] pandas numpy
Activate an environment called [ENV_NAME] conda activate [ENV_NAME]
Create an environment folder called env in the current working directory (e.g. /Users/Daniel/project_1/) and install pandas and numpy conda create --prefix ./env pandas numpy
Activate an environment stored in a folder called env, which is located within /Users/Daniel/project_1/ conda activate /Users/daniel/project_1/env
Deactivate an environment conda deactivate
Export your current active environment to a YAML file called environment (see why below) conda env export > environment.yaml
Export an environment stored at /Users/Daniel/project_1/env as a YAML file called environment (see why below) conda env export --prefix /Users/Daniel/project_1/env > environment.yaml
Create an environment from a YAML file called environment (see why below) conda env create --file environment.yaml
Install a new package, [PACKAGE_NAME] in a target environment conda install [PACKAGE_NAME] (while the target environment is active)
Delete an environment called [ENV_NAME] conda env remove --name [ENV_NAME]
Delete an environment stored at /Users/Daniel/project_1/env conda remove --prefix /Users/Daniel/project_1/env --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment