← 返回命令列表

Linux command

conda-deactivate 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Deactivate the current environment

conda deactivate

说明

conda deactivate exits the currently active conda environment, reversing the shell modifications made by conda activate. This restores the PATH and environment variables to their previous state, either returning to the base conda environment or, if environments were nested through multiple activation calls, returning to the previously active environment. The deactivation process removes the current environment's bin directory from PATH, unsets environment-specific variables like CONDA_PREFIX, and executes any deactivation scripts that packages may have installed. The shell prompt is typically updated to remove the environment name indicator, providing visual confirmation that the environment has been deactivated. Unlike some environment management systems that require explicit cleanup, conda deactivate is safe to call at any time and handles the state management internally. If no environment is currently active beyond the base environment, deactivating simply returns to a non-conda shell state. Conda supports nested environments, so multiple activate calls can be unwound with corresponding deactivate calls, though this is an advanced usage pattern.

FAQ

What is the conda-deactivate command used for?

conda deactivate exits the currently active conda environment, reversing the shell modifications made by conda activate. This restores the PATH and environment variables to their previous state, either returning to the base conda environment or, if environments were nested through multiple activation calls, returning to the previously active environment. The deactivation process removes the current environment's bin directory from PATH, unsets environment-specific variables like CONDA_PREFIX, and executes any deactivation scripts that packages may have installed. The shell prompt is typically updated to remove the environment name indicator, providing visual confirmation that the environment has been deactivated. Unlike some environment management systems that require explicit cleanup, conda deactivate is safe to call at any time and handles the state management internally. If no environment is currently active beyond the base environment, deactivating simply returns to a non-conda shell state. Conda supports nested environments, so multiple activate calls can be unwound with corresponding deactivate calls, though this is an advanced usage pattern.

How do I run a basic conda-deactivate example?

Run `conda deactivate` in a terminal, then adjust file names, paths, flags, or remote targets for your system.