This time I will explain and explain the environment of python and opencv that I recommend. Please refer to it by all means.
When I tried to build the environment, it was unexpectedly difficult, so I will write it here.
https://prog-8.com/docs/python-env https://www.sejuku.net/blog/54272
MacOS Catalina
Homebrew official homepage If you paste the script written here into the terminal and execute it, Homebrew will be installed.
brew install pyenv
Running the above will install pyenv.
There are some things you need to do before installing python.
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
source ~/.zshrc
It seems that this code needs to be executed in advance. (I run this code and nothing is displayed) Finally install python.
pyenv install --list
If you do this, you will find the libraries and python versions that you can currently install with pyenv. In my case, I install the latest stable version 3.8.2.
pyenv install 3.8.2
Doing this will install python3.8.2.
In my case I tried to install the official opencv, but after that it was difficult to set up and I chose the simple unofficial one.
pip install opencv-python
If you execute this and install opencv, the environment construction will be completed.
With this environment, you can do most of the things.
https://prog-8.com/docs/python-env https://www.sejuku.net/blog/54272
Recommended Posts