Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

brew uninstall python error: Refusing to uninstall

I decided to install python3 using brew: brew install python

How do I undo this? I tried brew uninstall python and got this error:

Error: Refusing to uninstall /usr/local/Cellar/python/3.7.7
because it is required by libxml2 and libxmlsec1, which are currently installed.
You can override this and force removal with:
  brew uninstall --ignore-dependencies python

I tried unlinking it brew unlink python - which worked, but am still unable to uninstall. Is the --ignore-dependencies the correct way to do this?

like image 392
ehacinom Avatar asked Sep 17 '25 04:09

ehacinom


1 Answers

To remove python using brew, you will need to first uninstall the dependencies indicated, i.e. execute:

brew uninstall libxmlsec1 && brew uninstall libxml2

After that, you should be able to uninstall python using brew uninstall python as you tried originally.

You could use the suggestion from the error message, brew uninstall --ignore-dependencies python, however the dependencies would remain installed but would not function, which may cause further problems down the line.

like image 111
dspencer Avatar answered Sep 19 '25 17:09

dspencer