Unfortunately, the "explicit spec" doesn't track temporary changes to channels like that. For example, if you installed
conda install -n my_env -c rdkit rdkit
it only treats the rdkit as the explicit spec. Technically, the above doesn't actually specify that rdkit must come from the rdkit channel. Instead, a more accurate interpretation is:
With the channel rdkit prioritized, ensure that my_env has some version of rdkit installed.
I think what you were hoping for (auto-adding of channels to envs) could be a useful behavior, but it is likely something to raise on the GitHub Issues and propose an expected behavior.
Including channel info in explicit specs
In the meantime, one can include channels explicitly in specs, e.g.,
conda install -n my_env rdkit::rdkit
which should result in literally rdkit::rdkit being included in the explicit spec. That is, "install rdkit from the rdkit channel".
Adding channels to an env
To explicitly add a channel to an env, one needs to activate the env and the use the conda config --env. For example,
conda activate my_env
conda config --env --add channels rdkit
Note, there are other options like --prepend and --append if one needs to be more precise about the priorities.