BeeClear guide

Python Storage on Mac: Old pyenv Versions and pip Cache

Python storage can come from several interpreters, project environments or pip’s download and build cache. Identify the source first: old versions need a project-dependency check, while pip provides commands for its cache.

Last updated:

Separate interpreters, environments and cache

Keep system-provided or system-tool Python installations and versions required by your projects. Review individual items rather than deleting an entire Python, .pyenv or project directory.

Three different storage sources
SourceContentsCheck first
pyenv versionAn installed Python versionDefaults, project .python-version files and virtual environments
Project environmentAn interpreter link or copy and installed packagesWhether the project needs it and which base Python it uses
pip cacheDownloaded responses and built wheelsActual pip cache dir and pip cache info output

Check the interpreter from the project

python -c "import sys; print(sys.executable); print(sys.prefix); print(sys.base_prefix)"
python -m pip --version

Open a terminal for the project and use the interpreter it actually runs. Here, python means that interpreter; substitute python3 or its full path when appropriate. These commands only inspect information.

The first command prints the executable, environment location and base Python location. Different sys.prefix and sys.base_prefix values identify a virtual environment. Check each active project and keep the base versions they need.

pyenv: uninstall only a confirmed unused version

pyenv versions
pyenv version
pyenv global

If you use pyenv, inspect installed versions and selection first. Run pyenv version in each active project and check .python-version, IDE settings and virtual environments. A version unselected in this terminal may still serve another project.

Once a specific version is no longer needed by projects or environments, use pyenv uninstall VERSION, replacing VERSION with its full installed version and checking the prompt. The pyenv-virtualenv plugin can remove linked environments too, so review them first.

After uninstalling, check the retained projects’ interpreters and usual commands, then compare available space on the same disk.

pip: inspect the actual cache

python -m pip cache dir
python -m pip cache info
python -m pip cache list

Use the target interpreter’s pip to inspect cache location, size and wheel entries. Environments can share a cache and configuration can change its location; use the command output.

Choose how much cache to remove

To remove cached wheels for one package, use python -m pip cache remove PACKAGE_NAME with its actual package name. This leaves the HTTP cache.

To clear both wheel and HTTP caches, first confirm the path reported by this pip configuration. Installed environment packages stay installed; later installations may download or build files again.

  1. Once you have confirmed this is the cache to clear, run python -m pip cache purge.
  2. Run python -m pip cache info again and compare available disk space.

If installed packages or environments hold most of the data, clearing the cache leaves that storage in place.

Review runtime candidates in BeeClear

BeeClear checks Python runtimes against defaults, project references and running processes. After scanning, review candidate paths and groups and retain versions your projects still use. Perform the pip cache operations above in Terminal.

BeeClear for Mac by PangJiong

BeeClear scans and analyzes files locally. Scanning and reviewing results are free; cleaning access is a one-time purchase in the app.

View BeeClear and download the official PKG · About PangJiong