0

I installed Miniconda on windows from https://docs.conda.io/en/latest/miniconda.html (Miniconda3 Windows 64-bit), which comes with a default python3.10.9 version

If I activate the base env

conda activate base

I get, as expected, the correct python executable:

where python

*\miniconda3\python.exe

When I create e new conda env without specifying the python version

conda create -n myenv

And activate it

conda activate myenv

I see that the corresponding python points again to the conda base python:

where python
*\miniconda3\python.exe

And not to the path

*\miniconda3\envs\myenv\python.exe

(python.exe doesn't even exist inside *\miniconda3\envs\myenv)

And if I install any package (with pip (***)) it is installed both on myenv and base environments. The two environments are entangled. So myenv is not a useful env.

If, instead, I create a conda env SPECIFYING the python version (even the 3.10.9, which is the python version of the base env), everything is fine:

conda deactivate
conda create -n myenv2 python=3.10.9
conda activate myenv2
where python

I get, as expected the path

*\miniconda3\envs\myenv2\python.exe

And now myenv2 works properly, as an isolated environment.

Is this behaviour expected? That is, I always have to specify the python version, even if it is the same as the base environment? Or there is a bug in my specific installation?

(***)-------------- EDIT --------------------

if I install any package with conda, everything 'magically' fixes: the package is installed in the myenv env and

where python
miniconda3\envs\myenv\python.exe

I think this is a weird behaviour. An environment should be created correctly from the beginning and not after a conda install
user17788510
  • 158
  • 1
  • 8

0 Answers0