The title says it. I installed conda and now all my terminals open in the base environment, "(base)" at the start of my prompts. If I type "conda deactivate" it drops out of base to someplace else, like no environment. How is this different from base?
(This question is a tangent from my other, asking if the expected workflow is for me to stay in base: With conda/anaconda should I work in (base) all the time?)
Conda allows you to create separate environments containing files, packages and their dependencies that will not interact with other environments. When you begin using conda, you already have a default environment named base. You don't want to put programs into your base environment, though.
This setting controls whether or not conda activates your base environment when it first starts up. You'll have the conda command available either way, but without activating the environment, none of the other programs in the environment will be available until the environment is activated with conda activate base.
Conda provides a number of ways to preserve and move environments. On installation, conda creates a base environment. However, you can also create your own base environment with packages you frequently use. The - -clone option will create a clone (or snapshot) of the environment,
Conda will use a spec list to download the exact packages in an environment. Alternatively, conda-pack archives an entire environment including the package binaries, which is useful in low or no bandwidth situations. Exporting an environment using conda is ideal for recreating environments across different platforms and operating systems.
activating a conda environment is not much more than applying settings to your shell to use a specific python interpreter (and the modules and libs associated to that interpreter)
when you drop out of a conda environment, your shell reverts to the python interpreter determined by your $PATH environment variable -- generally speaking, this default is typically a non-conda environment and is usually the default python installed with the OS (if applicable)
As freude is saying, the obvious way to see this in action is to do which python
as you activate/deactivate environments
When playing with python virtual environments in linux (and macOS), it is useful to use the command which python
or which pip
from the terminal. This command shows the path to the currently used python interpreter - that is the thing, together with the location of site packages, that differs one environment from another. The python environment is nothing else but a directory where you have a copy of your python interpreter and installed libraries. Switching from the (base)
to the deactivated (base)
implies switching from one python interpreter to another one - that may be checked using which
.
In windows, the closest equivalent of which
is where
.
Short answer: convenience.
When base
is activated: check out /anaconda3/bin/
you'll find all the binaries that will be included in the $PATH
environment variable (try echo $PATH
in your bash shell)
When base
is NOT activated: basically you only have conda
binary available to use by default. Once again, try echo $PATH
in your bash shell to see the difference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With