Forge
Forge

Reputation: 6834

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.

Upvotes: 8

Views: 7366

Answers (2)

Forge
Forge

Reputation: 6834

Deleting the directory /private/tmp/numpy solved it.

Upvotes: 0

AdjunctProfessorFalcon
AdjunctProfessorFalcon

Reputation: 1840

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

Upvotes: 1

Related Questions