I am facing some serious resistance with pandas
and specifically numpy
. When I try to run my current python program, I receive the following message:
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:
which Python
. You'll probably get something like /usr/bin/python
.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:
csrutil disable
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.