Where apps hide your files
A Mac usually has several Pythons, each with its own packages folder. One command shows which one pip is using, and the rest explains the layout, cache and cleanup.
pip installs into whichever Python it belongs to, so there is no single folder. Ask the interpreter you actually use:
python3 -m site
python3 -m pip --version
python3 -c "import sysconfig; print(sysconfig.get_paths()['purelib'])"
python3 -m site prints the full search path, plus USER_BASE and USER_SITE and whether they exist. pip --version shows the folder pip itself lives in, which is usually the site-packages it installs into (Apple's Python is the exception, below). Using python3 -m pip rather than a bare pip guarantees pip and the interpreter match.
The usual places on a Mac:
/Library/Frameworks/Python.framework/Versions/3.x/lib/python3.x/site-packages python.org installer
/opt/homebrew/lib/python3.x/site-packages Homebrew, Apple silicon
/usr/local/lib/python3.x/site-packages Homebrew, Intel
~/Library/Python/3.x/lib/python/site-packages pip install --user, Apple's Python
<project>/.venv/lib/python3.x/site-packages a virtual environment
Replace 3.x with your version. On the Mac used to check this guide, Apple's /usr/bin/python3 is Python 3.9.6 and runs from Xcode's developer folder, so its bundled packages sit under /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/site-packages, while packages you add go to ~/Library/Python/3.9/lib/python/site-packages.
To open your user folder, press ⇧⌘G in Finder and paste the path, or run open "$(python3 -c 'import site; print(site.getusersitepackages())')" (it only works once that folder exists).
A Mac can carry several Python installs at once, and each has its own packages:
/usr/bin/python3, which comes with the Xcode Command Line Tools or Xcode. Its own site-packages is not writable, so pip installs for it land in the user folder above even though pip --version points into Xcode.site-packages is the real folder at lib/python3.x/site-packages under the prefix (the Cellar copy is only a link to it), so packages survive Python updates. It is marked as externally managed, so a plain pip install is refused with an error telling you to use a virtual environment or pipx./Library/Frameworks/Python.framework.~/.local/share/uv/python (uv python dir prints it), and pyenv under ~/.pyenv/versions.If pip install worked but import fails, you almost certainly installed into a different Python from the one running your code. Compare python3 -m site with what your editor or script uses.
| Item | Meaning |
|---|---|
requests/ | The package's code |
requests-2.x.dist-info/ | Metadata: METADATA, the file list (RECORD), INSTALLER |
*.egg-info/ | Older style of the same metadata |
*.pth files | Lines that add extra folders to the import path |
__pycache__/ | Compiled bytecode, regenerated automatically |
*.so files | Compiled extensions, built for a particular Python version and CPU |
The dist-info folder is how pip knows what is installed and which files to remove. Deleting a package's code folder by hand leaves the record behind and confuses later installs.
pip keeps downloaded wheels and HTTP responses in a cache:
python3 -m pip cache dir
On macOS that is ~/Library/Caches/pip. Check its size with du -sh ~/Library/Caches/pip. The command python3 -m pip cache purge empties it, and that is safe because packages are downloaded again when needed.
Commands installed by packages (for example black or jupyter) land in a bin folder belonging to that Python. For user installs that is ~/Library/Python/3.x/bin, which is often not on your PATH. That is why a freshly installed tool says "command not found" until you add the folder to your PATH in ~/.zprofile.
Read-only first: python3 -m pip list shows installed packages and python3 -m pip show <name> shows a package's version and Location:, which is the quickest way to find where one package lives.
To remove one, use python3 -m pip uninstall <name>. To remove a project's packages entirely, delete its virtual environment folder (move .venv to the Trash in Finder); nothing else on the Mac depends on it. Never delete the Apple or Homebrew Python's own site-packages to clean up, since the interpreter and other tools need what is in there.
To move packages to another Mac or Python version, do not copy folders: compiled extensions are tied to the Python version and chip. Run python3 -m pip freeze > requirements.txt in the old environment, then python3 -m pip install -r requirements.txt in a fresh virtual environment on the new one. pip's documentation also covers changing the user install location with the PYTHONUSERBASE environment variable.
Most of these folders are in ~/Library, inside Xcode's app bundle or under hidden directories such as .venv, .pyenv and .local, and Spotlight leaves all of those out. Homebrew's folders under /usr/local or /opt/homebrew sit inside system folders that Finder hides, so a search by package name rarely leads you to the copy you need.
Type a package's folder name into Everywhere, such as numpy or requests-2, and every copy across the Mac appears with its full path, including those inside Xcode's bundle and in virtual environments (for a .venv in a project under Documents or the Desktop, grant Everywhere Full Disk Access first). The path tells you at once which Python owns each one. Press ⌘↵ to reveal it in Finder. It searches names only, so it cannot show the version recorded in a METADATA file; pip show does that.
Into the site-packages folder of the Python that pip belongs to. Run python3 -m site or python3 -m pip show <package> to see the exact path for your interpreter.
Apple's Python runs from Xcode or the Command Line Tools, and its own folder there is not writable, so pip installs go to ~/Library/Python/3.x/lib/python/site-packages.
In ~/Library/Caches/pip. python3 -m pip cache dir prints it and python3 -m pip cache purge clears it.
Homebrew and some other Pythons mark themselves as managed by another tool. Create a virtual environment with python3 -m venv .venv, or use pipx for command-line tools.
Everywhere keeps track of every file on your Mac — including the folders Spotlight hides and drives you have unplugged. Free for a day, then $19 once.
Version 2.20.3 · macOS 13+ · 4.7 MB · notarised