close

How to free disk space taken up by (ana)conda?

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about How to free disk space taken up by (ana)conda in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

Table of Contents

How to free disk space taken up by (ana)conda?

  1. How to free disk space taken up by (ana)conda?

    Conda already use symlinks when possible for packages. So, not much to improve here, I guess.

  2. free disk space taken up by (ana)conda

    Conda already use symlinks when possible for packages. So, not much to improve here, I guess.

Method 1

You can free some space with:

conda clean --all

clean Remove unused packages and caches.

Conda already use symlinks when possible for packages. So, not much to improve here, I guess.

Ok, thanks, but I would like to know “not for a specific environment, but in general” – for all environments.

You can list all packages in all envs with a few lines of Python:

import os
import subprocess
for env in os.listdir('/Users/me/miniconda3/envs'):
    subprocess.call(['conda', 'list', '-n', env])

Summery

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read