# Management Environments
## Create a new environment using requirements.txt file with packages
## where "data-science" is the name of the environment
## --yes : agree to confirmations
### For other packages like pyperclip
conda config --append channels conda-forge
conda create --name "data-science" --file requirements.txt --yes
## Create the environment from the environment.yml file
conda env create -f environment.yml
## Export the environment to a file for sharing / creation later
conda env export > environment.yml
conda env remove -n "ext" --all
## Install a new package in an environment
conda install -n "data-science" <package-names> --yes
## Activate the environment
conda activate "data-science"
## Deactivate the environment
conda deactivate "data-science"
## Delete an environment and its packages
conda remove -n ENVNAME --all
# Channel: Add conda-forge
# Add the 'conda-forge' channel as a backup to 'defaults'
conda config --append channels conda-forge
conda config --add channels conda-forge
conda config --add channels microsoft
## Update and clean all packages in current environment
conda update --all --yes; conda clean --all --yes
## Update all packages in the current environment
## List packages in the current environment
## Clean up unused packages
conda update -n base conda -c anaconda --yes
## See available Python versions with
conda search --full-name python
## Install a specific version, recommended approach is through a new environment and not the current environment
conda create -n py3d9 python=3.9 anaconda
conda create -n py311 python=3.11
## Update to the latest python in the current branch (e.g. 3.x)
## Install a specific version.
## It is not recommended, due to resolver has to work very hard to determine exactly which packages to upgrade