Python Guide

Removing Python pip Caches, Poetry Caches, Conda, and Virtualenvs on Mac

Last updated: 2026-04-13

Python's package ecosystem creates caches in ~/.cache/pip, ~/Library/Caches/pypoetry, and Conda/Miniconda/Anaconda installations. Each virtualenv duplicates the Python interpreter and all installed packages, so a handful of projects can easily consume several gigabytes. Add pyenv installations, pipx environments, and tool caches from Ruff, mypy, and pre-commit, and the total grows further. These are all safe to clean — pip and Poetry will re-download packages, and virtualenvs can be recreated.

pip cache

pip stores downloaded wheel and source distribution files at ~/.cache/pip (or ~/Library/Caches/pip on older setups). This cache speeds up repeated installs but grows indefinitely. You can check its size with `pip cache info` and clear it with `pip cache purge`. CodeCleaner detects this cache automatically.

Poetry cache

Poetry stores downloaded packages at ~/Library/Caches/pypoetry. It also maintains virtualenvs under ~/Library/Caches/pypoetry/virtualenvs. These can grow to several gigabytes, especially if you use Poetry across many projects. CodeCleaner detects both the package cache and Poetry-managed virtualenvs.

Conda and Miniconda

Conda installations (Anaconda or Miniconda) store packages and environments in their own directory trees, typically under ~/anaconda3 or ~/miniconda3. Each Conda environment is a full copy of the Python interpreter plus all packages. Unused environments from old projects can consume significant space. CodeCleaner detects Conda installations and shows their total footprint.

virtualenvs, pyenv, and pipx

Per-project virtualenvs (venv, .venv, env) duplicate Python and all packages. pyenv stores multiple Python versions under ~/.pyenv/versions. pipx installs standalone tool environments under ~/.local/pipx. CodeCleaner's Dev Caches module detects all of these, and the Project Scanner finds venv/.venv folders inside projects.

Tool caches: Ruff, mypy, pre-commit

Python development tools create their own caches — Ruff at ~/.cache/ruff, mypy at ~/.cache/mypy or .mypy_cache per project, and pre-commit at ~/.cache/pre-commit. These are small individually but add up. CodeCleaner includes them in the Python cache scan.

Virtualenvs and active projects

Deleting a project's .venv removes installed packages for that repo only — recreate it with your usual tool (python -m venv, poetry install, pipenv sync, etc.). Avoid removing Conda base environments you rely on for daily work; prefer removing named envs you have not opened in months.

Manual steps (Terminal)

You can do this manually with these commands, or use CodeCleaner to automate the process with a visual interface and safety checks. Each block shows a short label and the matching command.

Purge pip cache

pip cache purge

Clear Poetry cache

poetry cache clear --all .

Conda clean (all caches)

conda clean --all

Remove pip cache directory

rm -rf ~/.cache/pip

Remove Poetry cache directory

rm -rf ~/Library/Caches/pypoetry

Or use CodeCleaner

CodeCleaner automates all of this with a native macOS app. It auto-detects your installed tools, scans the relevant paths in parallel, shows per-item sizes, and lets you clean safely with one click. Free scan, no account required.

Related topics

Short landing pages focused on specific searches; each links back to the same download and safety model as the homepage.

CodeCleaner on the home page

Download, feature overview, and comparison with generic cleaners live on the main landing page.

Open homepage — download