Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't uninstall Numpy on Mac

I'm trying to uninstall numpy on OS X 10.10.5.

Here is what I've tried so far:

Uninstalling with brew:

brew uninstall numpy
Error: No such keg: /usr/local/Cellar/numpy

Uninstalling with pip:

sudo pip uninstall numpy
Cannot uninstall requirement numpy, not installed

The following Python library directories doesn't have Numpy files:

/usr/local/lib/python2.7/site-packages/
/Library/Python/2.7/site-packages/
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/

Printing the package path doesn't give the actual path:

In [1]: import numpy; numpy.__path__
In [2]: numpy.__path__
Out[2]: ['numpy']
In [3]: numpy.__file__
Out[3]: 'numpy/__init__.pyc'

The installed Numpy version is 1.8.0rc1 and I don't use a virtual environment.

like image 544
Forge Avatar asked Apr 21 '16 12:04

Forge


People also ask

How do I remove NumPy from my Mac?

Use the pip Command to Uninstall NumPy The pip command can install and uninstall most Python libraries through the console. No matter which OS you have, this command works on all the consoles.


1 Answers

You could try the following:

$ sudo rm -rf /usr/local/lib/python2.7/site-packages/numpy/ 
$ sudo rm -rf /usr/local/lib/python2.7/site-packages/numpy-*.egg* 
$ sudo rm -rf /usr/local/bin/f2py

If you want to verify where your packages are, you might try something like this:

>>> import site; site.getsitepackages()
['/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']

Then you could try removing when you know the precise location of the package, say for example if you were looking for your Flask installation:

$ grep -R flask*.* /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
like image 81
AdjunctProfessorFalcon Avatar answered Sep 17 '22 15:09

AdjunctProfessorFalcon