Properly include channels and channel prefix into conda env export --from-history
#12842
Labels
source::community
catch-all for issues filed by community members
type::feature
request for a new feature or capability
Checklist
What is the idea?
In short, I want the package list created by
conda env export --from-history
to be concise, cross-platform, and highly reproducible. There are two drawbacks in its current output.1. the missing channel problem
Now,
conda env export --from-history
includes packages that I’ve explicitly asked for. It works well when I only install packages from default channels. If I have installed some packages from third-party channels, such aspytorch
. It would not include the third-party channels.e.g. Here is the command to install pytorch.
Here is the output of
conda env export --from-history
The channel
pytorch
is missed, because I did NOT add 'pytorch' channel byconda config --add channels pytorch
, but just temporally add it byconda install -c pytorch
.2. the channel ambiguity
Nowadays, users usually install a package from a channel by
conda install -c
command. For the sake of cross-platform reproducibility, we should also include the channel prefix in the output ofconda env export --from-history
. e.g.This is because
pytorch
exists both inconda-forge
andpytorch
channel. To avoid the ambiguity, we need to explicitly specify the pytorch inpytorch
channel.Why is this needed?
It should include all channels these explicit packages come from, and add precise channel prefixes to the packages that come from non-default channels. see "What should happen?" for an example.
What should happen?
Here is an
environment.yml
I created manually. It represents the output ofconda env export --from-history
I expected and requested in this issue.It differs from the current output of
conda env export --from-history
in the following ways:conda config --add channels
.Additional Context
No response
The text was updated successfully, but these errors were encountered: