Conda

Conda is a popular open source package manager and environment manager.

For working with virtual python environment we can use conda like so:
# first lets create a virtual python environment with conda with python version 3.12:
conda create --name NN python=3.12

# we can see a list of environments by doing:
conda env list

# then we activate this newly created virtual environment called NN
conda activate NN

# now that we have activated this virtual environment, we can install a few things  that we need, for example to install pytorch libraries lets do
conda install pytorch::pytorch torchvision torchaudio -c pytorch

# after we are done installing dependencies we can freeze our environment and its requirments like so in a file called environment.yaml
conda env export > environment.yaml

# if we ever want to create this exact environment later on with the dependencies we would do
conda env create -f environment.yaml

# if we need to remove this virtual environment
conda env remove -n NN

# if we want to deactivate this conda environment
conda deactivate

# to prevent conda from auto activating the base environment by default
conda config --set auto_activate_base false
To prevent conda from auto activating the base environment by default
conda config --set auto_activate_base false