Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permission denied when uninstalling numpy with pip

Tags:

python

numpy

I am trying to uninstall Numpy via Pip but this error comes up:

$ pip uninstall numpy

Uninstalling numpy:
  /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.6.2-py2.7.egg-info
Proceed (y/n)? y
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-1.3.1-py2.7.egg/pip/basecommand.py", line 139, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-1.3.1-py2.7.egg/pip/commands/uninstall.py", line 54, in run
    requirement_set.uninstall(auto_confirm=options.yes)
  File "/Library/Python/2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 899, in uninstall
    req.uninstall(auto_confirm=auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 495, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-1.3.1-py2.7.egg/pip/req.py", line 1518, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip-1.3.1-py2.7.egg/pip/util.py", line 293, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
    os.unlink(src)
 OSError: [Errno 13] Permission denied: '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.6.2-py2.7.egg-info'

No clue what the best way to proceed from here would be. I would like to uninstall numpy completely then reinstall.

like image 234
okchip Avatar asked Feb 23 '16 02:02

okchip


People also ask

How do I uninstall all installed packages in Pip?

python -m pip uninstall [options] <package> ... python -m pip uninstall [options] -r <requirements file> ... Uninstall packages. pip is able to uninstall most installed packages. Known exceptions are: Pure distutils packages installed with python setup.py install, which leave behind no metadata to determine what files were installed.

How do I change the security permissions of my Python installation folder?

Show activity on this post. Change your Python installation folder's security permissions by: Add everyone and give them permission to Read and Write. If you open cmd as admin; then you can do the following: If Python is set in your PATH, then: Show activity on this post.

How do I run Pip install on Windows?

In case of windows, in cmd try to run pip install using python executable this should work, at least it worked for me for other package installation. Show activity on this post. Change your Python installation folder's security permissions by: Add everyone and give them permission to Read and Write.

What are the known exceptions to the Python installation process?

Known exceptions are: Pure distutils packages installed with python setup.py install, which leave behind no metadata to determine what files were installed. Script wrappers installed by python setup.py develop. Uninstall all the packages listed in the given requirements file. This option can be used multiple times.


2 Answers

try:

sudo pip uninstall numpy

or, if it doesn't work:

sudo apt-get remove python-numpy
like image 140
Francesco Nazzaro Avatar answered Oct 14 '22 02:10

Francesco Nazzaro


You need to add sudo, sudo pip uninstall numpy

like image 2
chantal Avatar answered Oct 14 '22 02:10

chantal