0

When trying to uninstall numpy I get the following message:

bvtmac00301:~ jonmc$ pip uninstall numpy
DEPRECATION: Uninstalling a distutils installed project (numpy) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling numpy-1.8.0rc1:
  /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info
Proceed (y/n)? y
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/commands/uninstall.py", line 76, in run
    requirement_set.uninstall(auto_confirm=options.yes)
  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 346, in uninstall
    req.uninstall(auto_confirm=auto_confirm)
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
    copy2(src, real_dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
    copystat(src, dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
    os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/var/folders/y1/7zsj8_x973n4xjwg5gg6s53jr4zz65/T/pip-C3YeRV-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info'

I'm trying to uninstall numpy in order to update it so it will run with pandas (which requires numpy 1.9). Running the following command

pip install -U numpy

gives the same result

Jon M
  • 164
  • 1
  • 12
  • What operating system are you using? Do you have appropriate permissions to copy or delete files from specified locations. In most linux distributions for example you should call `pip install -U numpy` as a root or using `sudo`. – running.t Dec 14 '17 at 22:19
  • macOS High Sierra. Yes I have root permissions. Running with sudo produces the same result sadly. – Jon M Dec 14 '17 at 22:20
  • Are there any flags on the directory `/System/Library/Frameworks/Python.framework`? You can see them with `ls -lO`. – bnaecker Dec 15 '17 at 00:04
  • I see `drwxr-xr-x 8 root wheel restricted 256 Dec 14 10:38 Python.framework` – Jon M Dec 15 '17 at 00:33
  • Possible duplicate of [OSX El Capitan: sudo pip install OSError: \[Errno: 1\] Operation not permitted](https://stackoverflow.com/questions/33004708/osx-el-capitan-sudo-pip-install-oserror-errno-1-operation-not-permitted) – phd Dec 15 '17 at 09:28
  • If `pip install --user numpy` gives you an `OSError`, it means your system is borked already. Installing packages as user along the system ones should always work. Probably you have tried to run the command as `sudo` and broke the local dir ownership. Run `sudo chown -R $(whoami):staff /Users/$(whoami)/Library/Python/` to fix, then retry `pip install --user numpy`. – hoefling Dec 15 '17 at 12:36
  • Also, using `sudo pip ...` is a bad idea in general, see the discussion (and the amount of linked issues) [here](https://github.com/pypa/pip/issues/1668). – hoefling Dec 15 '17 at 12:43

1 Answers1

0

Try:

pip install pandas --user
Danny
  • 114
  • 4
  • 9