moth
moth

Reputation: 375

What is the use of non-separated anaconda environments?

I noticed that when a conda environment is created without specifying the python version:

conda create --name snowflakes 

instead of:

conda create --name snowflakes python=3.6

the environments are not separated and share the package with the default python interpreter.

Thereupon, What is the use of non-separated anaconda environments?

EDIT - 20170824: The question has been solved. Actually non-separated environments do not exist. With the first command there is no new Python interpreter installed so that it calls the first that it finds in the PATH being the standard Python interpreter because there is no other.

Upvotes: 1

Views: 695

Answers (1)

darthbith
darthbith

Reputation: 19645

I think you are misunderstanding the word "separate" in the docs. In the docs, they mean "separate" in the sense of "create a new environment, with a new name to try some new things". They do not mean that you are creating a different kind of conda environment. There is only one kind of environment in conda, what you are calling the "separated" environment. All packages in all environments are always unique. It so happens that the first command creates an empty environment with no packages. Therefore, when the new environment is activated, the PATH environment variable looks like: ~/miniconda3/envs/snowflakes/bin:~/miniconda3/bin:... Now, since there is no Python installed into ~/miniconda3/envs/snowflakes/bin (because the snowflakes environment is empty), the shell still finds Python in ~/miniconda3/bin as first on the path. The snowflakes environment does not share with the root environment. For instance, if, after creating, you type conda install -n snowflakes python it will install a new version of Python that won't find any packages! Therefore, there is only one kind of environment in conda, what you are calling the "separated" environment.

Upvotes: 1

Related Questions