I'm sota, a local go apprentice. Since it is a beginner, please comment if you have any mistakes, improvement measures, suggestions or questions.
This is a memorandum when I installed mac cleanly and re-installed python3 with homebrew. The specific error is 1.
brew install python3
...
error: could not delete '/usr/local/lib/python3.7/site-packages/pip/_internal/configuration.py': Permission denied
...
It is a problem that python3 (/ usr / bin) which is included by default is called even after installing python3 (/ usr / local / bin) with brew.
brew install python3
, I could only install it halfway with the above error.
this is
/usr/local/lib/python3.7/site-packages/
Was occurring because the user was root.for that reason,
sudo chown -R [your user name] /usr/local/lib/python3.7/site-packages
It was solved by changing the user in.
Even after resolving the error in 1. and installing python 3.7.7
% python3
Python 3.7.3 (default, Apr 24 2020, 18:51:23)
And 3.7.7 will not start. The operation of pip3 was also suspicious. Looking at the path
% which python3
/usr/bin/python3
It has become.
This is because the python installed by brew comes to / usr / local / bin
.
But,
echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
/ usr / local / bin
is at the beginning of $ PATH and should be fine.
I'm not sure about this,
.bashrc or .zshrc (The default shell for mac has recently changed to zsh.)
export PATH=/usr/local/bin:$PATH
Add and do source .bashrc
or source .zshrc
.
with this
% echo $PATH
/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Next,
% which python3
/usr/local/bin/python3
% python3
Python 3.7.7 (default, Mar 10 2020, 15:43:33)
I was able to solve it safely. pip3 solved it as well.
/usr/local/bin:/usr/local/bin:
It's mysterious and unpleasant, but I was able to work, so I made a compromise here .. If anyone knows the cause or meaning of this, please let us know in the comments.
Recommended Posts