Skip to content

Instantly share code, notes, and snippets.

@nashid
Last active February 23, 2024 02:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nashid/260b48fa8dee63b2059b61e9f08c7914 to your computer and use it in GitHub Desktop.
Save nashid/260b48fa8dee63b2059b61e9f08c7914 to your computer and use it in GitHub Desktop.
conda managing environment
  1. Create conda environment:

If you are creating a new environment, use the following commands:

conda create --name new-env python=3.11
conda activate new-env

If you are using an existing environment, use the following command:

conda env create --name new-env --file=env.yml
  1. Update the required Python libraries if dependencies have changed:
conda env update --name new-env --file env.yml --prune
  1. Always update the requirements file after installing new libraries:
conda env export --no-builds | grep -v "^prefix: " > env.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment