How to uninstall all packages from homebrew, distribute, macports, pip?

Over the course of the year I've become more familiar with programming on OS X, and I think in my initial excitement I installed a whole bunch of things that I won't use and that pollute my development environment.

In particular, I find that with pip, brew, port, and easy_install, I've added all sorts of packages for all sorts of versions, and even for different systems (Snow Leopard and Mountain Lion).

So now, I was wondering if there was any way for me to start from scratch? I'd prefer to keep my files and programs, so no reinstalling the OS. If there is an easy way to mass uninstall packages for each of the four, that would help tremendously.


pip and easy_install install the mostly the same thing (both are tools that install most of the same packages).

First get a list of all installed packages, as you might want to keep some:

$ pip freeze > packages.txt

This should be a fairly large file that lists most (if not all) packages that you have installed in your default system python.

Edit that file and delete those packages that you want to keep, so it contains only those you want to get rid of (and no other lines or comments), then adjust the following script:


for plugin in $(cat packages.txt); do
    PLUGIN=$(echo "$plugin" | awk -F == '{print }')
    echo "Uninstalling $PLUGIN..."
    expect -c "spawn pip uninstall $PLUGIN
    expect {
        \"Proceed (y/n)?\" {
            send \"y\r\n\"
            expect {

For macports, see the uninstalling guide and associated warnings.

For brew, see this superuser question

Coincidentally, that should tell you that such questions belong at, and not on stackoverflow - which is for programming related queries.

Don't worry - someone will eventually move your thread there.

2.4. Uninstall MacPorts, pip and easy_install install the mostly the same thing (both are tools that install most of the same packages). First get a list of all installed packages, as you might � pip is installed by default with and Homebrew Python, but needs to be manually installed on Macports with sudo port install py36 - pip Once pip is installed, you can install Matplotlib and all its dependencies with from the command line:

On Linux I use:

$ pip freeze > args | pip uninstall -y -r args | rm args

On Windows I use:

$ pip freeze > args | pip uninstall -y -r args | del args

-y flag autoconfirm deletion, so it will not prompt you for if you would like to delete that package -r tells to use requirements file, the name of the file in my example is args which was created by pip freeze > args

How to Install PyInstaller — PyInstaller 3.6 documentation, If you want to uninstall MacPorts and the port command is functioning, first uninstall all the installed ports by running this command in the Terminal: $ sudo port� Pyzo: A free distribution based on Anaconda and the IEP interactive development environment. Supports Linux, Windows and Mac. Installing via pip. Most major projects upload official packages to the Python Package index. They can be installed on most operating systems using Python’s standard pip package manager. Note that you need to have

On MacOS you can use:

brew list | xargs brew uninstall

Installation — Cryptography 3.1.dev1 documentation, You can download the archive from PyPi, but it is easier to install using pip where is is Python interpreters and install packages such as PyInstaller in each of them. recommend that you install these using either MacPorts or Homebrew. On all platforms, the command pyinstaller should now exist on the execution path . a character vector with the names of the packages to be removed. lib. a character vector giving the library directories to remove the packages from. If missing, defaults to the first element in .libPaths. warning. boolean (TRUE), should a message be printed in various cases. currently ignored.

Removing Existing PostgreSQL Installations, You can install cryptography with pip : $ pip install The wheel package on Windows is a statically linked build (as of 0.5) so all dependencies are included. To install You can compile OpenSSL yourself as well or use a binary distribution. You'll also need OpenSSL, which you can obtain from Homebrew or MacPorts. Brew Uninstall Packages. The command to remove a package from the Homebrew installation list is as follows: brew uninstall packageName. For example, to remove Python, you should use the following command line: brew uninstall python3. In fairness, it should be clarified that there are two commands to remove packages – brew remove and brew

Installing Sphinx — Sphinx 4.0.0+ documentation, app might not be able to start. Homebrew. $ brew remove postgresql. MacPorts. First use the installed command to determine� MacPorts is an easy to use system for compiling, installing, and managing open source software. MacPorts may be conceptually divided into two main parts: the infrastructure, known as MacPorts base, and the set of available ports.

Installing scikit-learn — scikit-learn 0.23.2 documentation, Usually the package is called python3-sphinx , python-sphinx or sphinx . Be aware macOS�. Sphinx can be installed using Homebrew, MacPorts, or as part of a Python distribution such as Anaconda. Once Python is installed, you can install Sphinx using pip. This tool is provided with all modern versions of Python. Install Python 3 using homebrew (brew install python) or by manually installing the package from Install python3 and python3-pip using the package manager of the Linux Distribution. Install conda (no administrator permission required).