conda clean — conda 24.3.1.dev56 documentation (2024)

Remove unused packages and caches.

usage: conda clean [-h] [-a] [-i] [-p] [-t] [-f] [-c [TEMPFILES ...]] [-l] [--json] [-v] [-q] [-d] [-y]

Removal Targets#

-a, --all

Remove index cache, lock files, unused cache packages, tarballs, and logfiles.

-i, --index-cache

Remove index cache.

-p, --packages

Remove unused packages from writable package caches. WARNING: This does not check for packages installed using symlinks back to the package cache.

-t, --tarballs

Remove cached package tarballs.

-f, --force-pkgs-dirs

Remove all writable package caches. This option is not included with the --all flag. WARNING: This will break environments with packages installed using symlinks back to the package cache.

-c, --tempfiles

Remove temporary files that could not be deleted earlier due to being in-use. The argument for the --tempfiles flag is a path (or list of paths) to the environment(s) where the tempfiles should be found and removed.

-l, --logfiles

Remove log files.

Output, Prompt, and Flow Control Options#

--json

Report all output as json. Suitable for using conda programmatically.

-v, --verbose

Can be used multiple times. Once for detailed output, twice for INFO logging, thrice for DEBUG logging, four times for TRACE logging.

-q, --quiet

Do not display progress bar.

-d, --dry-run

Only display what would have been done.

-y, --yes

Sets any confirmation values to 'yes' automatically. Users will not be asked to confirm any adding, deleting, backups, etc.

Examples:

conda clean --tarballs
conda clean — conda 24.3.1.dev56 documentation (2024)

FAQs

How do you clean up the conda environment? ›

Conda clean is a command-line function that removes unused packages and caches from your Conda environment. It's a handy tool for freeing up disk space and keeping your Conda environment tidy. The command has several options, including -p to remove unused packages, -t to remove tarballs, and -a to remove everything.

How do I delete everything from conda environment? ›

How to Uninstall All Unused Packages in a Conda Virtual...
  1. Step 1: Identify Your Conda Environment. ...
  2. Step 2: Activate Your Conda Environment. ...
  3. Step 3: List All Installed Packages. ...
  4. Step 4: Identify Unused Packages. ...
  5. Step 5: Uninstall Unused Packages. ...
  6. Step 6: Verify the Uninstallation.
Aug 8, 2023

How do I manually delete a conda environment? ›

The command used to remove a Conda environment is conda env remove --name env_name , where env_name is the name of the environment you want to remove. This command will delete the specified environment, along with all its associated packages and dependencies.

What is anaconda clean? ›

GitHub - ContinuumIO/anaconda-clean: removes configuration files that are left behind when uninstalling Anaconda.

Where is the conda cache? ›

By default, the package cache is in your home directory ($HOME/. conda/pkgs). If installing a large amount of software that may cause the home directory quota to be exceeded, you can configure another directory to be the package cache by adding a pkgs_dirs list to the $HOME/. condarc file.

How to delete conda from terminal? ›

Use the commands: rm -rf . conda and then rm . condarc . Delete all of the above conda code.

Where are conda environments stored? ›

All created conda environments are in the Installed Conda Environments category. You can install either Data Science or published conda environments. All Installed Conda Environments are stored in your Block Volume in the /home/datascience/conda directory.

How do I uninstall all packages in Python env? ›

Uninstall a Python package

Open a terminal window. Use the command ' pip3 uninstall <package-name> '. Depending on how the package was installed, you may need to replace the pip3 command with the version of Pip that was used to originally install the package.

How to open conda environment? ›

Step-by-Step Guide to Activating Conda Environment from PowerShell
  1. Step 1: Install Anaconda. ...
  2. Step 2: Open PowerShell. ...
  3. Step 3: Enable unrestricted Powershell script execution. ...
  4. Step 4: Initialize Conda. ...
  5. Step 5: Create a Conda Environment. ...
  6. Step 6: Activate the Conda Environment.
Aug 8, 2023

How do I delete a conda file? ›

Select the Anaconda/Miniconda installation you want to uninstall. Click Uninstall. Complete the uninstall instructions that appear. (Optional) If you have created any environments outside your anaconda3 directory, you can manually delete them to increase available disc space on your computer.

How do you activate and deactivate the environment in Anaconda? ›

You activate (deactivate) an environment using the conda activate ( conda deactivate ) commands. You install packages into environments using conda install ; you install packages into an active environment using pip install . Use the conda env list command to list existing environments and their respective locations.

How can I speed up my conda solving environment? ›

Reduce the index. One option for speeding up conda is to reduce the index. The index is reduced by conda based upon the user's input specs. It's likely that your repodata contains package data that is not used in the solving stage.

How do I clean my Anaconda files? ›

You can also use the anaconda-clean tool. Just open Terminal in your Mac and run these commands – conda install anaconda-clean and anaconda-clean or anaconda-clean –yes. To remove the entire Anaconda directory, you can run the command – rm -rf ~/anaconda3 in Terminal. To remove anaconda backups, run rm -rf ~/.

How do I update all packages in the conda environment? ›

You can update all installed packages in a specific environment by using the --all tag. Using the --all flag unpins all the packages in the current environment and updates them to the latest version, if possible.

How to delete environment in Python? ›

Delete or remove a Python environment

Right-click the Python environment that you want to remove, and select Remove. If you want to keep the Python environment but remove it from your project, select Remove. If you want to delete the environment permanently, select Delete.

Top Articles
Latest Posts
Article information

Author: Velia Krajcik

Last Updated:

Views: 6401

Rating: 4.3 / 5 (74 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Velia Krajcik

Birthday: 1996-07-27

Address: 520 Balistreri Mount, South Armand, OR 60528

Phone: +466880739437

Job: Future Retail Associate

Hobby: Polo, Scouting, Worldbuilding, Cosplaying, Photography, Rowing, Nordic skating

Introduction: My name is Velia Krajcik, I am a handsome, clean, lucky, gleaming, magnificent, proud, glorious person who loves writing and wants to share my knowledge and understanding with you.