How to Uninstall Python and Node.js on a Mac
To uninstall Python or Node.js on a Mac, first find out which copy you are removing, because there are usually several and each one comes out a different way. Run which -a python3 or which -a node to see every copy on your PATH, then remove each one through the tool that installed it: Homebrew with brew uninstall, pyenv with pyenv uninstall, nvm with nvm uninstall, conda with Anaconda's documented steps, and the python.org or nodejs.org installers by removing the files their packages wrote. Leave /usr/bin/python3 alone; it belongs to macOS and Apple's developer tools.
After that, clean up the lines those tools added to your shell startup files and the caches they left in your home folder. This guide goes in that order: identify, remove, clean PATH, clear caches, verify.
Find every Python and Node on your PATH
These commands only read:
which -a python3 python node npm
type -a python3 node
python3 -c 'import sys; print(sys.executable)'
which -a prints every match in PATH order, and the first line is what runs when you type the command. type -a also shows aliases and shell functions, which matters for version managers: nvm, for example, defines nvm as a shell function, and pyenv and some setups put shims in front of real binaries. Follow a symlink with ls -l to see where it really points.
Read the paths against this table:
| Path starts with | Who installed it | How it comes out |
|---|---|---|
/usr/bin/python3 |
macOS, for Xcode and the Command Line Tools | Leave it |
/Library/Frameworks/Python.framework or /usr/local/bin links into it |
python.org installer | Remove its three parts (below) |
/opt/homebrew (Apple silicon) or /usr/local/Cellar, /usr/local/opt (Intel) |
Homebrew | brew uninstall |
~/.pyenv/shims or ~/.pyenv/versions |
pyenv | pyenv uninstall |
~/anaconda3, ~/miniconda3, /opt/anaconda3, /opt/miniconda3 |
Anaconda or Miniconda | conda init --reverse, then remove the folder |
/usr/local/bin/node that is not a Homebrew link |
nodejs.org installer | Remove its files, forget its receipt |
~/.nvm/versions/node |
nvm | nvm uninstall |
~/Library/Application Support/fnm or ~/.fnm |
fnm | fnm uninstall, then remove the folder |
~/.volta |
Volta | Remove ~/.volta |
On an Intel Mac, both Homebrew and the nodejs.org and python.org installers write into /usr/local, so check with ls -l whether a file there is a link into Homebrew's Cellar before assuming it is yours to delete.
Do not remove the macOS Python
The Python documentation for macOS is explicit: recent versions of macOS include a python3 command in /usr/bin/python3 that links to a version of Python provided by and for the Apple development tools, and you should never modify or attempt to delete it, because it is Apple-controlled and used by Apple-provided and third-party software. It sits on the sealed system volume anyway. A second Python from python.org or Homebrew can coexist with it; you change which one runs through PATH, not by deleting Apple's.
Uninstall Python installed from python.org
The python.org installer puts three things on the Mac, per the same documentation: a Python 3.x folder in Applications with IDLE and Python Launcher, the framework at /Library/Frameworks/Python.framework, and symlinks to the executables in /usr/local/bin. The documentation says that to uninstall Python you can remove these three things.
Remove one version at a time. For example, for 3.12:
ls /Library/Frameworks/Python.framework/Versions
ls -l /usr/local/bin | grep 'Python.framework/Versions/3.12'
The first command lists the installed versions; the second shows which links in /usr/local/bin point into the version you are removing. Then move /Applications/Python 3.12 to the Trash, delete /Library/Frameworks/Python.framework/Versions/3.12 with administrator rights, and delete only the links the second command printed. If you remove the last version, the whole Python.framework folder can go.
The installer also leaves a receipt, which you can find with pkgutil --pkgs | grep -i python. A receipt does not run, but pkgutil --files <id> shows exactly what that package wrote, which is the most reliable list of paths. How to uninstall .pkg apps explains reading and forgetting receipts.
Uninstall Python installed with Homebrew
Homebrew names Python formulae by version, such as python@3.13. Check what is installed and what depends on it first:
brew list --formula | grep '^python'
brew uses --installed python@3.13
If brew uses prints other formulae, they need that Python, and Homebrew will refuse to uninstall it while they remain. Remove the dependents first or keep that version. When nothing depends on it, brew uninstall python@3.13 removes it, and brew autoremove clears dependencies nothing else needs. Removing Homebrew itself is a separate, much bigger job; see how to uninstall Homebrew.
Uninstall pyenv versions or pyenv itself
The pyenv README says to remove old versions with pyenv uninstall <version>, and that pyenv prefix <version> shows a version's directory. Plugins may do extra work on uninstall; pyenv-virtualenv, for example, also removes virtual environments linked to that version.
pyenv versions
pyenv uninstall 3.11.9
To remove pyenv completely, the README says to remove all pyenv configuration lines from your shell startup files, then remove its root directory with rm -rf $(pyenv root), which deletes every Python installed under it. If you installed pyenv with Homebrew, finish with brew uninstall pyenv. Run pyenv root first and read the path it prints before deleting anything.
Uninstall Anaconda or Miniconda
Anaconda's uninstall guide and the matching Miniconda guide use the same three steps on macOS:
- Remove conda's initialization from your shell profiles: run
conda activate, thenconda init --reverse --all. - Delete the install folder. Anaconda notes it can be in your home folder or in
/opt, depending on how you installed;conda info --baseprints the actual location. Typical paths are~/anaconda3,~/miniconda3,/opt/anaconda3or/opt/miniconda3, and the/optones needsudo. - Optionally remove the hidden configuration and data files
~/.condarc,~/.condaand~/.continuum. Anaconda suggests keeping.condarcif you have custom settings and plan to reinstall.
The guide warns that rm -rf deletes without confirmation and cannot be undone, so check the path before you press Return. Environments you created live inside the install folder or under ~/.conda, so export any you need first with conda env export -n <name> > env.yml.
Uninstall Node.js installed from nodejs.org
The official macOS package is two packages in one. Node's own installer definition registers them as org.nodejs.node.pkg and org.nodejs.npm.pkg, and its closing screen says it installed node to /usr/local/bin/node and npm to /usr/local/bin/npm (installer source). The npm package also links npx into /usr/local/bin from /usr/local/lib/node_modules/npm.
List what the packages wrote before removing anything:
pkgutil --pkgs | grep -i nodejs
pkgutil --pkg-info org.nodejs.node.pkg
pkgutil --files org.nodejs.node.pkg | head -50
--pkg-info shows the install location, and the file list is relative to it. Remove what the two lists name, which centers on /usr/local/bin/node, npm and npx and the /usr/local/lib/node_modules/npm folder. Look inside /usr/local/lib/node_modules before deleting the whole folder: global packages you installed with npm install -g live there too. Then run sudo pkgutil --forget org.nodejs.node.pkg and the same for org.nodejs.npm.pkg, which removes only the receipts.
Uninstall Node from Homebrew, nvm, fnm or Volta
Homebrew: brew uninstall node, or the versioned formula such as node@20. brew uses --installed node shows anything that depends on it.
nvm: nvm ls lists installed versions and nvm uninstall <version> removes one, together with the global packages installed for it. To remove nvm itself, the nvm README says to run nvm unload, delete its directory ($NVM_DIR, by default ~/.nvm), and remove the NVM_DIR export and the lines that source nvm.sh and bash_completion from your shell config. nvm does not support Homebrew installation, so an nvm that came from Homebrew should be removed with brew uninstall nvm.
fnm: fnm list and fnm uninstall <version> manage versions. The fnm README says removing fnm means deleting its folder and removing references to fnm from your shell configuration, such as the eval "$(fnm env ...)" line. Its default data folder on macOS is ~/Library/Application Support/fnm; older installs used ~/.fnm. A Homebrew-installed fnm also needs brew uninstall fnm.
Volta: per the Volta docs, remove the ~/.volta directory and the two lines that mention Volta in your shell profile.
Clean PATH lines from your shell startup files
Installers and version managers add lines to these files, and the lines stay after the software is gone:
grep -n -E 'python|Python.framework|pyenv|conda|nvm|fnm|volta|node' ~/.zshrc ~/.zprofile ~/.bash_profile ~/.bashrc ~/.profile 2>/dev/null
The output lists the file and line number for each match. Edit the file in a text editor and delete the lines that belong to what you removed: export PATH=... lines pointing into Python.framework, the pyenv init lines, the >>> conda initialize >>> block if conda init --reverse could not run, the nvm and fnm lines, and Volta's two lines. Leave lines you do not recognize until you know what they do. Open a new terminal window afterward; an open one keeps its old PATH, and hash -r clears zsh's remembered command locations in the current one.
Caches and data left behind
Uninstalling an interpreter does not clear its package caches:
| Cache | Location | How to clear |
|---|---|---|
| pip | ~/Library/Caches/pip by default on macOS; pip cache dir shows the active one |
pip cache purge, run before removing the last pip, or delete the folder |
| npm | ~/.npm, with packages in ~/.npm/_cacache |
npm cache clean --force, or delete the folder after Node is gone |
| conda packages | pkgs inside the install folder, or ~/.conda/pkgs |
Removed with the install folder; ~/.conda is optional |
The pip caching docs give the macOS default and pip cache purge. The npm cache docs note that clearing the cache is usually unnecessary while you still use npm, because it is self-healing; once Node is gone, the folder is just data.
Project virtual environments are a separate case. A .venv created with a Python you removed points at an interpreter that no longer exists and stops working. Delete and recreate it with the Python you kept, from the project's requirements.txt or lockfile. The same goes for node_modules with native modules built for an old Node version.
Where Mole fits
Mole does not uninstall interpreters or version managers; use the commands above for that. Its Clean tab is useful afterward for the caches. pip's macOS default folder, ~/Library/Caches/pip, appears as its own row under App Caches & Logs, and ~/.cache/pip (the XDG location some setups use) as a pip cache row under Developer Tools; both are selected by default, since pip downloads what it needs again. Developer Tools also lists npm's _cacache and _npx folders as rows left unticked because the next install downloads them again, a default-selected Unused npm Cache Data group for cache files npm's own index no longer references, npm logs, and Conda's ~/.conda/pkgs as an unticked row. The unticked rows stay that way until you choose them, and nothing is removed before you confirm. Why Mole clears less npm cache than npm cache verify explains the npm rule, and how to clear developer caches covers other toolchains.
Verify
Open a new terminal window and run:
which -a python3 node
python3 --version
node --version
The copy you removed should no longer appear. If /usr/bin/python3 is the only Python left, that is the system copy and is expected. "command not found" for node is the right answer when you meant to remove every Node. If an old version still runs, its PATH line is still in one of your shell files or another installer put a second copy elsewhere; go back to the first step.
FAQ
How do I uninstall Python on a Mac?
Run which -a python3 to see which copy you have, then remove it the way it was installed: brew uninstall python@3.x for Homebrew, pyenv uninstall for pyenv, or remove the Applications folder, framework version and /usr/local/bin links for python.org. Do not delete /usr/bin/python3, which belongs to macOS.
How do I uninstall Node.js on a Mac?
Use brew uninstall node for Homebrew, nvm uninstall <version> for nvm, or for the nodejs.org installer remove /usr/local/bin/node, npm, npx and the npm folder under /usr/local/lib/node_modules, then forget the org.nodejs.node.pkg and org.nodejs.npm.pkg receipts.
How do I completely uninstall Anaconda on a Mac?
Run conda activate and conda init --reverse --all, delete the install folder that conda info --base reports, such as ~/anaconda3 or /opt/anaconda3, and optionally remove ~/.condarc, ~/.conda and ~/.continuum.
Can I delete the Python that comes with macOS?
No. The Python documentation says /usr/bin/python3 is Apple-controlled, used by Apple and third-party software, and should never be modified or deleted. Install another Python beside it and choose which one runs through PATH.
Why does python3 still run after I uninstalled Python?
Either another copy is still on your PATH, often /usr/bin/python3 from macOS, or your terminal still has the old PATH. Open a new window, run which -a python3, and remove leftover PATH lines from ~/.zshrc or ~/.zprofile.