Error and solution when installing python3 with homebrew on mac (catalina 10.15)

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.

  1. error: could not delete '/usr/local/lib/python3.7/site-packages/pip/_internal/configuration.py': Permission denied When I tried to update python with 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.

2. Problem that python3 (/ usr / bin) which is included by default is called even after installing python3 (/ usr / local / bin) with brew

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

Error and solution when installing python3 with homebrew on mac (catalina 10.15)
[Python] Error and solution memo when using venv with pyenv + anaconda
Error when installing a module with Python pip
Install Python 3 on MacOS Catalina (with Homebrew only)
Solution when aws-cli cannot be executed on Mac virtual environment (after installing Python 3.8)
Install selenium on Mac and try it with python
Notes on installing Python on Mac
Installing Python 3 on Mac and checking basic operation Part 1
Error when playing with python
Catalina on Mac and pyenv
Error that occurred in OpenCV3 and its solution Precautions when using OpenCV3 on Mac
Minimum notes when using Python on Mac (Homebrew edition)
Notes on deploying pyenv with Homebrew and managing Python versions
[python] Error when installing library ramkan
Error when building mac python environment
Introducing OpenCV on Mac with homebrew
Support when installing pillow on python3.9
Note: When Python is run on ImageJ Fiji, java.lang.IllegalArgumentException appears and its solution (mac OS)
Build a Python environment on your Mac with Anaconda and PyCharm
How to deal with errors when installing Python and pip with choco
Install lp_solve on Mac OS X and call it with python.
Error resolution when installing numba on macOS
Solution for pip install error [Python] [Mac]
A memo with Python2.7 and Python3 on CentOS
Follow active applications on Mac with Python
Notes on building Python and pyenv on Mac
Build Python environment with Anaconda on Mac
Error, warning when using TensorFlow on Mac
Installing PIL with Python 3.x on macOS
Check! Troubleshooting when installing PyObjc on Mac
Settings when using Python 3 requests and Beautiful Soup with crostini on Chromebook
Put MeCab binding for Python with pip on Windows, mac and Linux
Notes on setting pyenv and python environment using Homebrew on Mac OS Marvericks
Send and receive binary data via serial communication with python3 (on mac)
Create a Python3 environment with pyenv on Mac and display a NetworkX graph
python on mac
Recommended environment and usage when developing with Python
Notes on installing Python3 and using pip on Windows7
Install OpenCV 4.0 and Python 3.7 on Windows 10 with Anaconda
Try working with Mongo in Python on Mac
Put Python 2.7.x on Mac OSX 10.15.5 with pyenv
[Note] Installing Python 3.6 + α on Windows and RHEL
Homebrew Vim doesn't start with Python 3.8 error Note
Try importing MLB data on Mac and Python
Install Python and libraries for Python on MacOS Catalina
Build a Python + bottle + MySQL environment with Docker on RaspberryPi3! [Trial and error]
To avoid seeing hell when installing django-toolbelt on windows, heroku and python3.4 (64bit) ...
What to do if you get an error when installing python with pyenv
Install Python3 on Mac and build environment [Definitive Edition]
What to do if you get an OpenSSL error when installing Python 2 with pyenv
Notes on HDR and RAW image processing with Python
Findings when accelerating numerical calculations with Python and Numba
Install Python on Mac
Install Python 3 on Mac
Automatic follow on Twitter with python and selenium! (RPA)
Installing pandas on python2.6
Get comments on youtube Live with [python] and [pytchat]!
Instructions for installing CUDA 7.5 on Mac (El Capitan) + Homebrew
Install PyQt5 with homebrew on Mac OS X Marvericks (10.9.2)
Troublesome story when using Python3 with VScode on ubuntu
Ubuntu 20.04 on raspberry pi 4 with OpenCV and use with python