Oserror: [errno 1] Operation Not Permitted:
Solution 1:
I assume you are on macOS (otherwise, the --user flag, or running with sudo
, should solve the issue).
The issue is likely that you are trying to upgrade the same Python that macOS uses for its internal operations. Mac is concerned that ignorant users will delete Python and destabilize their OS, so, they put /usr/bin/python
in a "wheel" directory that you will not be able to touch (even with sudo).
To confirm this is the problem, try this:
- Open terminal and type
which Python
. You'll probably get something like/usr/bin/python
. - Type
ls -l /usr/bin/python
, where you use the path from step 1. The output will look like-rwxr-xr-x 1 root wheel 66880 Sep 21 00:35 /usr/bin/python
See how it says "wheel"? Wheel is a super-protected group that you can't touch, even with sudo.
To get around this, one option is to install a new copy of Python somewhere else. Personally, I hate having multiple copies of the same software, so I would force it to upgrade like this:
- Reboot the computer in recovery mode
- Find the terminal and type
csrutil disable
- Reboot normally, then upgrade numpy with pip2 `install --user --upgrade numpy
- Repeat steps a and b, this time changing "disable" to "enable"
Note: "csrutil disable" is serious business that can destabilize your machine, I would use it only when absolutely necessary and re-enable it ASAP. But AFAIK it's the only way to upgrade Python packages in a wheel directory.
Post a Comment for "Oserror: [errno 1] Operation Not Permitted:"