4

I have heard some pretty good reviews of Anaconda, and have decided to start using miniconda3.

I am mostly concerned with storage space when it comes to the use of virtual environments. I notice that I am able to install a package in a virtual environment, without installing it in the base environment, with the use of the following command

>>>conda install -n test_env numpy

this is verfied when I check that the following command has no output

>>>conda list -n base | grep numpy
>>>

while this command has the expected output

>>>conda list -n test_env | grep numpy
>>>numpy                     1.16.5           py37hacdab7b_0  
   numpy-base                1.16.5           py37h6575580_0  

It appears to me that the packages are stored in each virtual environment, if I were to clone my environments, I would thus have a copy of the same package residing in each environment. Isn't that very poor space management? Is my understanding incorrect?

Tian
  • 870
  • 3
  • 12
  • 24
  • conda downloads packages in the package chache (by default in the `pkgs` dir of your anaconda distribution). The individual environments do not contain copies, but merely link to the package in the package cache. – cel Sep 22 '19 at 08:58
  • But doesnt that mean that ```conda list -n base | grep numpy``` should show some output? Since the base environment is located in the anaconda distribution – Tian Sep 22 '19 at 10:05
  • 2
    No, because the base environment is not used as the package cache. It's just another (albeit special) environment and it too links to packages in the package cache. – cel Sep 22 '19 at 10:09
  • I see, where is the package cache stored? – Tian Sep 22 '19 at 10:12
  • 2
    @Tian `conda info` will tell you where your packages are stored. – Swier Sep 22 '19 at 10:36
  • Possible duplicate of [Why are packages installed rather than just linked to a specific environment?](https://stackoverflow.com/questions/55566419/why-are-packages-installed-rather-than-just-linked-to-a-specific-environment) – merv Sep 22 '19 at 14:27

0 Answers0