What you observed is correct and is exactly how conda
is supposed to work.
Using the commands conda activate my_env
and conda install python=3.8
you first tell conda
to activate the virtual environment named my_env
and then install Python 3.8 in it.
A virtual environment is an environment (think of it as a special folder) that is used to install Python (or another supported language), as well as packages and their dependencies, independently from the main OS. It has the big advantage that all packages installed in it won't affect the ones that come preinstalled with the OS, so they can be handled (updated, downgraded, removed, etc.) separately, effectively eliminating breakages of the main system due to unsatisfied dependencies, etc. In the case of Python specifically, this is one of the most common reasons that users end up with a broken system.
So, in your case in which you wanted to use Python 3.8 in my_env
, Python 3.8 would have to be downloaded again, since, as said before, the environment's Python version is independent of the main OS's version. You cannot, or, better, you shouldn't, use the system's installation in your virtual environment, as this would defy the purpose of having a virtual environment in the first place and could easily lead to a broken system.