0

According to this page, the envs folder has a peer folder pkgs for all the packages. The different environments contain hard links to the packages. I tried to find how disk space was alloted between the package repository and the environments in my installation. I have only the base environment, which contains Python 3.7, and a py39 environment containing Python 3.9.

I tried to find the envs and pkgs folders in my Windows 10 installation of Anaconda. It has been tricky.

According to the Anaconda FAQ, it should be in C:\Users\<your-username>\Anaconda3, but I have no such folder. I do have c:/Anaconda 3, but it just contains Anaconda3-2019.07-Windows-x86_64.exe, which I think is the installation executable from long ago.

I used Cygwin's find to search the c-drive for all folders named envs:

  • The following are all empty. In the following sub-bullets, I assumed that the User Name_G30.02 subtree is just a snapshot of user account files from an old computer and disregarded them.

    • /c/User Name_G30.02/.conda/envs
    • /c/User Name_G30.02/AppData/Local/conda/conda/envs
    • /c/User Name_G30.02/AppData/Local/Continuum/anaconda3/envs
    • /c/ProgramData/Anaconda3/envs
    • /c/Users/User.Name/AppData/Local/conda/conda/envs
  • Found what I think are the pkgs and envs folder: Using Cygwin's du -sh in c:/Users/User.Name/.conda, I have a 5.6GB pkgs folder and a envs folder containing only a 135MB py39 environment

  • Determined volume of files linked to from py39 environment: Using du -sh in c:/Users/User.Name/.conda/envs shows that the sole py39 folder contains hard links to 4.1G of packages

The envs folder in the last bullet above does not appear to include the base environment. Where can I find the base environment in order to check the volume of packages to which it hard links?

user2153235
  • 388
  • 1
  • 11
  • Can you start a `anaconda command prompt` or `anaconda powershell prompt` and do `echo %CONDA_PREFIX%` and/or `python -c "import sys; print(sys.path)"`. The first should give you the base dir of your base env. The latter should give you the site-package directory associated with your base – FlyingTeller Jun 19 '23 at 13:53
  • Thanks, Flying Teller. I found a lot of package folders using that process. Is the organization scheme of packages and how they are linked to from the various environments documented anywhere? It's obviously not as simple as outlined here, so my plan to assess the disk footprint of the packages required by each environment seems to be naive. – user2153235 Jun 20 '23 at 21:10
  • Maybe you might be interested in https://docs.conda.io/projects/conda/en/latest/dev-guide/deep-dives/install.html#download-and-extraction and the folowing paragraphs? – FlyingTeller Jun 21 '23 at 05:51
  • @FlyingTeller: It may be that one has to plough through all those details to build up an organizational scheme of packages and environments, but it's a bit beyond me at present. I'm not even a Python coder yet, and just getting to know conda. That page describes a lot about *how* conda maintains its packages, but I find that the actual organizational scheme itself is hard to infer from that description. I appreciate the citation nevertheless. Thanks. P.S. Did you want to post your initial comment as the answer? It seems to be. – user2153235 Jun 21 '23 at 21:05
  • You are right. That document is really in-depth and much more than what you want, but I am glad if I could help you get a bit further along with your quest – FlyingTeller Jun 22 '23 at 06:50

1 Answers1

1

Start a terminal with the base environemnt being active. On windows, this is done by starting an anaconda command prompt or anaconda powershell prompt

There you can check the value of the environment variable CONDA_PREFIX, which contains the path to the currently active env:

echo %CONDA_PREFIX%

alternatively, you could also check where the python interpreter is located, either with

where python

or

python -c "import sys; print(sys.executable)"
FlyingTeller
  • 17,638
  • 3
  • 38
  • 53