Mehrdad Salimi
Mehrdad Salimi

Reputation: 1426

Difference of `conda deactivate` and simply closing the Conda terminal

Sometimes I use the command conda deactivate (on windows) to deactivate the conda environment, but sometimes I forget it and directly close the Conda terminal. Does closing terminal directly may have some bad effects on the Conda environment?

Upvotes: 5

Views: 4012

Answers (1)

Andrew Holmgren
Andrew Holmgren

Reputation: 1275

You probably shouldn't be using conda deactivate at all (it's primarily used for cleaning up and removing an environment, or for undoing nested activation).

https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#deactivating-an-environment

To simply return to the base environment, it's better to call conda activate with no environment specified, rather than to try to deactivate. If you run conda deactivate from your base environment, you may lose the ability to run conda at all. Don't worry, that's local to this shell - you can start a new one. However, if the environment was activated using --stack (or was automatically stacked) then it is better to use conda deactivate.

There's no harm in simply closing the terminal window.

Upvotes: 4

Related Questions