—— As simple as possible ――Because I have just started, I will do my best with python3 --Because it is confusing, Python version switching is only pyenv global --I want to use jupyter, so install anaconda with pyenv --opencv3 installed separately -The basic idea of version switching is tailored to this person: Qiita
$brew install python
$brew install pyenv
$pyenv install anaconda3-4.0.0 (insert the newest one)
$pyenv global anaconda3-4.0.0
$pyenv rehash
$brew tap homebrew/science
$brew install opencv3 --with-python3
Described below in .bash_profile etc. Please refer to ~ / .pyenv first.
export PYENV_ROOT="${HOME}/.pyenv"
export PATH=${PYENV_ROOT}/bin:$PATH
eval "$(pyenv init -)"
Start jupeter notebook, create a new note of python3, and confirm that there is no error in import cv2.
By installing anaconda, anaconda navigator will appear on the Mac desktop. There is a start button for jupyter and Ipython, but if you type a command from the terminal normally, it will start. .. ..
It seems that you can switch the environment (Python version) with this, but it does not switch well in your own environment.
$pyenv versions
The environment created in is displayed, but it does not switch. .. ..
An environment created with $ pyenv global navigator
Even if it doesn't switch ...
what's this? ??
(After installing Anaconda3 below, it was switched according to the environment construction method when I wanted to use python2.7)
Minimum notes when using Python on Mac (Homebrew edition) Doesn't switch with pyenv global! Environment construction method when you want to use python2.7 after installing Anaconda3 Note from installing Homebrew to building an Anaconda environment for Python with pyenv The story that the Homebrew environment was blown away when Anaconda was added
Recommended Posts