The conda deactivate command exits the currently active Conda environment and returns to the base environment (or the system default if base is not activated). It is the standard way to stop using an isolated Python environment when you have finished your work in it.
Conda Deactivate Syntax
conda deactivate
No arguments are needed. The command deactivates whichever environment is currently active. Your terminal prompt changes from (myenv) $ to (base) $ to indicate you are back in the base environment.
Deactivate to Base, Then Deactivate Base
Running conda deactivate once from a named environment returns to base. Running it again from base exits the Conda environment system entirely, returning to the system Python if one exists. This is useful when you need to use system Python or when Conda is interfering with non-Conda tools.
Conda Deactivate vs conda activate base
conda deactivate and conda activate base produce different results. deactivate exits the current environment and returns to whatever was active before activation (usually base or no environment). conda activate base explicitly activates the base environment regardless of what is currently active — it is more predictable when writing scripts or CI/CD pipelines.
Frequently Asked Questions
What happens if I run conda deactivate with no active environment?
If you run conda deactivate when no named environment is active (you are already at base or not in any Conda environment), Conda exits the environment system. On some systems this produces a warning; on others it completes silently. Either way, no harm is done.