In using Conda environments, I am not understanding the correct way to access packages that are in the root environment. Especially for development, when I am not sure from the very beginning exactly what packages I will end up needing, having access to easily import packages from base is important!
For example, I need an environment that uses geopandas, but also several packages that are in the base (pandas, os, numpy, glob).
What is the best / "correct" way to do this?
The two methods I have used are:
- First clone base environment with
conda create --name geoEnv --clone base
, and then run further commands to add new packages that are not in the base environment, e.g.coda install geopandas
and then,conda install -c conda-forge pysheds
(to add something from a specific channel). - Simply create a new environment, and install new packages on the fly as needed. For example, start off with
conda create --name geoEnv
, activate the environment, and install packages one by one as I go and find I need them, e.g.conda install pandas
,conda install glob
, all separately. This is time-intensive, download-intensive, and quite annoying.
What is the better way I'm missing here? I wish there was a way to tell Anaconda "if the package I am importing is not in this environment, please import it from the base environment". Is there such a setting?
I've reviewed the anaconda documentation, and stack overflow questions, with no resolution. I WANT the behavior observed in this stack overflow post as a problem ; not sure how to get it!!