Get out of root conda environment

conda delete environment
conda install
conda init
anaconda environment path
get rid of a conda environment
conda environment variables
conda command to remove an environment
conda delete environment stackoverflow

Once I have installed miniconda, I am permanently inside the root miniconda environment eg:

luc@montblanc:~$ conda info --envs
# conda environments:
#
bunnies                  /home/luc/miniconda3/envs/bunnies
expose                   /home/luc/miniconda3/envs/expose
testano                  /home/luc/miniconda3/envs/testano
testcondaenv             /home/luc/miniconda3/envs/testcondaenv
root                  *  /home/luc/miniconda3

Which results on the use of this environment python3 executable:

luc@montblanc:~$ which python3
/home/luc/miniconda3/bin/python3

How can I get out of this root environment without actually uninstalling python. E.g. I want

luc@montblanc:~$ which python3
/usr/bin/python3

and refer to the miniconda distribution of python explicitly (using full path /home/luc/miniconda3/bin/python3) when I need it.

I don't want to achieve any final goal doing this, I just want to understand what is happening and how it works.

Managing environments — conda 4.8.3.post173+cc216085 , How to set up a virtual environments using conda for the Anaconda If you have a vanilla Python installation or other Python distribution see virtualenv yourenvname” will install the package to the root Python installation. 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.

Or you can also just use conda deactivate. For a regular python environment, deactivate or source deactivate should work, but if you try that, you get a hint to use conda deactivate instead.

(base) mooreb@ubtest2:~$ deactivate
DeprecationWarning: 'source deactivate' is deprecated. Use 'conda deactivate'.
(base) mooreb@ubtest2:~$ conda deactivate
mooreb@ubtest2:~$

Create virtual environments for python with conda, That's the "base" environment from Anaconda or Miniconda. It means the Python environment from conda is enabled by default. There're two solutions. JeremyEnns commented on Nov 14, 2016 When creating a new environment from a clone of the root environment, it copies conda-env into the new environment. Even though you cannot install conda-env into a sub environment manually and users can remove it after cloning but this should be excluded just like conda and conda-build are.

Here is a way to do this on the fly without editing one's init files:

    (base) ➜  ~ which python
    /home/xxx/anaconda3/bin/python
    (base) ➜  ~ echo $PATH
    /home/xxx/anaconda3/bin:/home/xxx/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
 (base) ➜  ~ export PATH=$(echo ${PATH} | awk -v RS=: -v ORS=: '/conda/ {next} {print}' | sed 's/:*$//')
    (base) ➜  ~ echo $PATH                                                                
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
    (base) ➜  ~ which python
    /usr/bin/python
    (base) ➜  ~ 

How do I remove the source (base) from my terminal?, other than the root conda environment, run activate environment-name . The Python image in a conda environment called “my-env” might be in a location If you have installed Miniconda instead of Anaconda, the folder might be named:. macOS and Linux¶. Open a terminal window. If you want the location of a Python interpreter for a conda environment other than the root conda environment, run conda activate environment-name.

Finding your Anaconda Python interpreter path — Anaconda , Anaconda Navigator is a graphical user interface to the conda package and Now you have two environments, the default environment base (root) , and� Only the package names are listed and conda is left to build the environment based on the package names. Another difference is that - -export also includes packages installed using pip whereas a spec list does not. To export an environment.yml file: <span>conda env export > environment.yml</span>

Getting started with Navigator — Anaconda documentation, Windows user will have to use Anaconda Prompt if you never add the Conda environment path to your windows environment variable. Using your conda environment in a notebook¶ Whether you have created an environment using conda in a terminal, or from the Conda tab in a notebook, you can use the conda environment in the same way. When working in a notebook, to select the environment you have created and want to use with that notebook, in the Kernel menu, select Change Kernel.

Manage your Python Virtual Environment with Conda, #Diagnosing the Conda install issue: It was not possible for me to get GDAL If you would like to get rid of the entire environment, merely type in: conda in the current env conda install -n root conda-build Building Your Own� Conda environments¶ A conda environment is a directory that contains a specific collection of conda packages that you have installed. For example, you may have one environment with NumPy 1.7 and its dependencies, and another environment with NumPy 1.6 for legacy testing. If you change one environment, your other environments are not affected.

Comments
  • I had to restart the terminal after commenting this line. But it finally works, thank you.