Jess Stuart
Jess Stuart

Reputation: 67

Can Anaconda3 / Conda Maintain Pristine Base Environment?

I would like to have my base conda environment to be pristine (i.e. installed with the least amount of packages possible).

Right now, my base environment has a few dozen packages in them, and I'm concerned I'm creating conflicts with any new environments I'm creating for older versions of Python.

My hope is I can have the proper versions available to VSCode Python projects without conflicts from older projects when I create a new env in conda.

Upvotes: 1

Views: 32

Answers (1)

Pushkar
Pushkar

Reputation: 140

You can start with removing the packages in your base conda you don't need necessarily.

I would suggest always create virtual environments and install dependencies as per the need of project. If the requirements of 2 projects differ a lot, create a new virtual environment. You can always delete a virtual env without worrying about affecting your base conda environment. That will help you maintain even different python versions if you want. I assume you know defining env paths and creating virtual environments using python or conda. For reference:

python -m venv env_name

.\env_name\Scripts\activate # activation
deactivate                  # deactivation
conda create -n test_env python=3.10.14 anaconda
#Activate
conda activate test_env
#Deactivate
conda deactivate

Finally, you can add paths to your base environment in your new venv, in case you need dependencies that are in your base environment.

export PATH=path_to_base_conda:$PATH Hope this helps!

Upvotes: 0

Related Questions