{"id":59952,"date":"2024-02-28T13:11:46","date_gmt":"2024-02-28T13:11:46","guid":{"rendered":"https:\/\/www.askpython.com\/?p=59952"},"modified":"2025-04-10T20:37:45","modified_gmt":"2025-04-10T20:37:45","slug":"uninstall-python3-macos","status":"publish","type":"post","link":"https:\/\/www.askpython.com\/python\/examples\/uninstall-python3-macos","title":{"rendered":"How to Uninstall Python3 on MacOS?"},"content":{"rendered":"\n<p>Python is one of the most popular programming languages used today for everything from web development and scientific computing to machine learning and data analysis. While Python comes pre-installed on MacOS, you may eventually want to uninstall Python, whether to upgrade to a newer version or remove it completely from your system.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><em>The easiest way to fully uninstall Python 3 from MacOS is to delete the Python application, remove any related symlinks in \/usr\/local\/bin, get rid of pip\/virtualenvs\/cached files using sudo rm, and delete remaining Python directories with find \/ -name &#8220;Python&#8221; -exec rm -rf {} \\;. Checking which python should then return an error, indicating Python is removed. Be sure to back up any files first!<\/em><\/p>\n<\/blockquote>\n\n\n\n<p>This step-by-step guide will walk you through the process of fully removing Python 3 and its related components from your MacOS machine.<\/p>\n\n\n\n<p><strong><em>Also read: <a href=\"https:\/\/www.askpython.com\/python\/examples\/fix-bash-python3-command-not-found\" data-type=\"post\" data-id=\"57312\">[Fix] Bash: Python3: command not found When Installing&nbsp;discord.py&nbsp;on Windows<\/a><\/em><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-uninstall-python\">Reasons to Uninstall the Default Python<\/h2>\n\n\n\n<p>There are a few common reasons you may want to uninstall Python from your Mac:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Upgrade to a Newer Python Version<\/strong>&nbsp;&#8211; If you want to upgrade to a newer version of Python (e.g. from Python 3.7 to 3.8), completely uninstalling the previous Python version clears away any potential conflicts.<\/li>\n\n\n\n<li><strong>Remove No Longer Needed Packages<\/strong>&nbsp;&#8211; If you installed Python for a short-term project or no longer need it on your system, you can optimize storage space by deleting it.<\/li>\n\n\n\n<li><strong>Eliminate Issues\/Bugs<\/strong>&nbsp;&#8211; If you are experiencing crashes, import errors, or other bugs with your Python installation, fully removing and reinstalling Python can help resolve underlying issues.<\/li>\n\n\n\n<li><strong>Change Installation Method<\/strong>&nbsp;&#8211; Transitioning to a version manager like pyenv or Anaconda may require removing any existing Python installations.<\/li>\n<\/ul>\n\n\n\n<p>Before uninstalling, ensure you have copies of any important Python programs or packages you want to save. The uninstall process&nbsp;<strong>will delete everything Python-related<\/strong>&nbsp;on your system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"how-to-fully-uninstall-python-3-on-macos\">Step-by-Step Guide to Uninstall Python on MacOS<\/h2>\n\n\n\n<p>Uninstalling Python on Mac requires removing the Python application itself plus any related packages, cached files, and symlinks. Here is the full process:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-1-remove-the-python-framework\">Step 1: Remove the Python Framework<\/h3>\n\n\n\n<p>The first step is to remove the actual Python framework.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open Finder and go to your&nbsp;Applications&nbsp;folder<\/li>\n\n\n\n<li>Drag the&nbsp;<strong>Python 3<\/strong>&nbsp;app to the Trash (may be called&nbsp;Python 3.7,&nbsp;Python 3.8&nbsp;etc depending on your version)<\/li>\n<\/ol>\n\n\n\n<p>Deleting this application will remove the central Python executable file.<\/p>\n\n\n\n<p>However, we need to delete many hidden folders and symlinks related to Python.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-2-remove-python-symlinks\">Step 2: Remove Python Symlinks<\/h3>\n\n\n\n<p>Even after removing the Python application, symlinks to Python still exist on your system that can cause conflicts.<\/p>\n\n\n\n<p>To list all symlinks, open Terminal and type:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nls -la \/usr\/local\/bin | grep &quot;..\/Frameworks\/Python.framework\/Versions&quot;\n\n<\/pre><\/div>\n\n\n<p>This will print any Python symlinks in&nbsp;\/usr\/local\/bin.<\/p>\n\n\n\n<p>Next, delete the symlinks by running:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo rm \/usr\/local\/bin\/the_symlink_name\n\n<\/pre><\/div>\n\n\n<p>For example, if you see a symlink called&nbsp;\/usr\/local\/bin\/python3, run:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo rm \/usr\/local\/bin\/python3\n\n<\/pre><\/div>\n\n\n<p>Repeat this for EVERY symlink returned from the initial list command. This cleans up leftover Python references.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-3-remove-pip-and-virtual-environments\">Step 3: Remove pip and virtual environments<\/h3>\n\n\n\n<p>Next, we need to remove any Python package manager files. Even if Python itself is gone, these can still take up disk space and cause conflicts.<\/p>\n\n\n\n<p>To remove&nbsp;<strong>pip<\/strong>, run:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo rm -rf \/Library\/Frameworks\/Python.framework\/Versions\/3.8\/bin\/pip3*  \n\n<\/pre><\/div>\n\n\n<p>Make sure to use your specific Python version if different from 3.8.<\/p>\n\n\n\n<p>Next, remove any&nbsp;<strong>virtual environments<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo rm -rf ~\/Library\/Python\/3.8\/lib\/python\/site-packages\/\n\n<\/pre><\/div>\n\n\n<p>And remove&nbsp;<strong>cached Python files<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo rm -rf ~\/Library\/Caches\/pip\n\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"step-4-delete-remaining-python-directories\">Step 4: Delete remaining Python directories<\/h3>\n\n\n\n<p>At this point, Python should be mostly removed from your Mac. However, some empty Python directories may still be present.<\/p>\n\n\n\n<p>To delete these, run the following&nbsp;<strong>clean up script<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nfind \/ -name &quot;*Python*&quot; -exec rm -rf {} \\;\nfind \/ -name &quot;*python*&quot; -exec rm -rf {} \\; \n\n<\/pre><\/div>\n\n\n<p>This will search your entire system and delete any leftover folders with \u201cpython\u201d or \u201cPython\u201d in the name.<\/p>\n\n\n\n<p>Run this several times to ensure you catch everything.<\/p>\n\n\n\n<p>Once finished, Python should be completely wiped from your system!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-5-check-your-work\">Step 5: Validate the Uninstallation<\/h3>\n\n\n\n<p><strong>As one final check, run the following command:<\/strong><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nwhich python3\n\n<\/pre><\/div>\n\n\n<p>If Python was successfully uninstalled, you should see an error like:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\npython not found\n\n<\/pre><\/div>\n\n\n<p>Rather than pointing you to an executable Python file.<\/p>\n\n\n\n<p>If Python still seems to be lurking, repeat the symlink removal and folder deletion steps above.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-6-reinstall-python-optional\">Step 6: Reinstall a New Python Version (Optional)<\/h3>\n\n\n\n<p>If you only uninstalled Python in order to upgrade versions or switch installation methods, you can reinstall Python:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>To install the&nbsp;<strong>latest Python 3 release<\/strong>, run:&nbsp;brew install python<\/li>\n\n\n\n<li>For a&nbsp;<strong>specific minor version<\/strong>, use:&nbsp;brew install python@3.8<\/li>\n\n\n\n<li>You can also install Python&nbsp;<strong>via pyenv<\/strong><\/li>\n<\/ul>\n\n\n\n<p><strong><em>Read: <a href=\"https:\/\/www.askpython.com\/python\/examples\/install-python-with-conda\" data-type=\"post\" data-id=\"58609\">Step-by-Step Guide to Installing Python Using Conda<\/a><\/em><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"key-benefits-of-removing-python-from-macos\">Key Benefits of Removing Python from MacOS<\/h2>\n\n\n\n<p>Fully uninstalling Python offers the following advantages:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Frees up disk space by removing unneeded files<\/li>\n\n\n\n<li>Eliminates version conflicts if upgrading Python versions<\/li>\n\n\n\n<li>Gets rid of bugs or issues with a botched installation<\/li>\n\n\n\n<li>Allows a clean install of Python via symlink managers like pyenv<\/li>\n\n\n\n<li>Avoids package conflicts between Python environments<\/li>\n<\/ul>\n\n\n\n<p>So while removing Python may seem like an advanced maneuver, there are many benefits for developers and Pythonistas. Follow the steps in this guide to smoothly delete Python and reclaim disk space on your Mac. Did you find this guide helpful for uninstalling Python on your Mac? Let us know if you have any other useful tips!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python is one of the most popular programming languages used today for everything from web development and scientific computing to machine learning and data analysis. While Python comes pre-installed on MacOS, you may eventually want to uninstall Python, whether to upgrade to a newer version or remove it completely from your system. The easiest way [&hellip;]<\/p>\n","protected":false},"author":77,"featured_media":63967,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-59952","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-examples"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/posts\/59952","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/users\/77"}],"replies":[{"embeddable":true,"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/comments?post=59952"}],"version-history":[{"count":0,"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/posts\/59952\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/media\/63967"}],"wp:attachment":[{"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/media?parent=59952"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/categories?post=59952"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.askpython.com\/wp-json\/wp\/v2\/tags?post=59952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}