The conda documentation says that when you use
conda create --name myenv
The new environment
uses the same version of Python that you are currently using because you did not specify a version.
However, that's not the case for me. I have Windows 10 and Anaconda. I am into the "base" environment created by default.
If I run
conda create --name testenv
Then when I activate the environment
conda activate testenv
There is no Python. If I write
python
to the console the Microsoft Store is opened.
To have a Python interpreter I need to manually specify it
conda create --name testenv2 python=3.8
That specific note in the Conda documentation was a hold-over from before Conda v4.4 and has since been corrected (see here and here).
Previous to Conda v4.4, the base environment's bin/
directory was always on the PATH
, hence why not installing a Python interpreter in a new environment it would fall back to the base Python. Conda v4.4 introduced a new strategy for managing environment isolation via defining the primary interface to Conda as a set of shell functions and allowing the base bin
directory only to be included on PATH
when the base environment was active. This strategy provides cleaner isolation of environments, which means that only what is in the active environment will be available.
Hence, if you want Python in the environment, it must be explicitly installed.