$ brew install pyenv
Then add the following to your environment variables: For example, if you are using zsh for your shell, add the following to ~ / .zshrc: If you use bash, add it to ~ / .bash_profile.
~/.bash_profile
export PATH="$PYENV_ROOT/bin:$PATH"
export PYENV_ROOT="$HOME/.pyenv"
eval "$(pyenv init -)"
$ pyenv install anaconda3-x.x.x
$ pyenv install anaconda2-x.x.x
You can switch the version with pyenv global hogehoge or pyenv local hugahuga. If you set it to global, the version change will be reflected as a whole, and if you set it to local, the version switching will be reflected under the current directory.
Python3 + OpenCV3
$ conda install -c https://conda.anaconda.org/menpo opencv3
Python2 + OpenCV2
$ conda install -c menpo opencv=2.4.11
afterwards
$ pyenv rehash
To make sure it's installed properly, start Python and run the following code.
import cv2
cv2.__version__
Recommended Posts