Windows cmd.exe: installing a package changes activation and deactivation behavior #13850
Open
2 tasks done
Labels
cli::cmd
pertains to the CLI in CMD
os::windows
relevant to Windows
plugins::activate
pertains to conda-activate or conda-deactivate
source::anaconda
created by members of Anaconda, Inc.
type::bug
describes erroneous operation, use severity::* to classify the type
Checklist
What happened?
Overview
Using
cmd.exe
, the activation and deactivation behavior is inconsistent between environments with and without packages installed.(base)
.base
environment from within an environment with a package installed appears to make that environment thebase
environment. For empty environments, thebase
environment is activated instead.Activation methods impacted
The behavior is observed with the activation methods of
conda
:Scripts\activate.bat <prefix>
(with and without<prefix>
)condabin\activate.bat <prefix>
(with and without<prefix>
)condabin\conda_hook.bat <prefix> && conda activate
(with and without<prefix>
)It does not happen with the PowerShell hook.
Observed behavior
Creating an empty environment, activating, and deactivating it should change the command line prefix from
(base)
to(<environment name>)
to(base)
:When installing a package, however, the command line prefix after deactivation is the path to the base environment:
This is irreversible - activating and deactivating from there on out results in the path of the base environment being used instead of
(base)
:Activating the
base
environment from within this environment appears to make the new environment the base environment.This behavior is a little less reproducible, i.e., I have seen some instances where the
base
environment is activated, but I have not been able to isolate these circumstances.Behavior of empty environments
Empty environments are not impacted, even if created afterwards:
Conda Info
Conda Config
Conda list
Additional Context
I tested it only on Windows 11, but I don't see a reason why other Windows operating systems would behave differently.
I used a fresh Miniconda installation every time I tested a new activation method.
There is another Miniconda installation on the system (23.11.0), but I can reproduce the behavior there, too. I omitted those environments from the
conda info --env
output.The text was updated successfully, but these errors were encountered: