$ brew install pyenv
$ brew upgrade pyenv
/.bashrc で pyenv を起動するよう設定
export PYENV_ROOT="${HOME}/.pyenv" export PATH=${PYENV_ROOT}/bin:$PATH eval "$(pyenv init -)"
$ pyenv install -l | grep anaconda3-5 anaconda3-5.0.0 anaconda3-5.0.1 anaconda3-5.1.0 $ pyenv install anaconda3-5.1.0
$ pyenv versions * system (set by /Users/atsushi/.pyenv/version) anaconda3-5.1.0 $ pyenv global anaconda3-5.1.0 $ python -V Python 3.6.4 :: Anaconda, Inc.
これで、すべての環境で python が Anaconda の Python 3.6.4 になった。
"$ pyenv local anaconda3-5.1.0" ならば一時的
$ source activate myenvの代わりに
$ conda activate myenvを使うことを推奨 → https://github.com/conda/conda/blob/a4c4feae404b2b378e106bd25f62cc8be15c768f/CHANGELOG.md#440-2017-12-20
/.bashrc に anaconda の環境変数を設定する
export PS1="[\w]\$ "
export LANG="ja_JP.UTF-8"
# for pyenv
export PYENV_ROOT="${HOME}/.pyenv"
export PATH=${PYENV_ROOT}/bin:$PATH
eval "$(pyenv init -)"
# for anaconda
. /Users/atsushi/.pyenv/versions/anaconda3-5.1.0/etc/profile.d/conda.sh
[~]$ conda create -n jupyter-env python=3.6
[~]$ conda info -e # conda environments: # base * /Users/atsushi/.pyenv/versions/anaconda3-5.1.0 jupyter-env /Users/atsushi/.pyenv/versions/anaconda3-5.1.0/envs/jupyter-env
[~]$ conda activate jupyter-env (jupyter-env) [~]$
(jupyter-env) [~]$ conda deactivate [~]$
[~]$ conda remove -n jupyter-env --all
[~]$ conda activate jupyter-env (jupyter-env) [~]$ conda list
(jupyter-env) [~]$ conda search <<pkg>>
(jupyter-env) [~]$ conda install <<pkg>>
(jupyter-env) [~]$ conda update <<pkg>>
(jupyter-env) [~]$ conda remove <<pkg>>
[~]$ pyenv versions system * anaconda3-5.1.0 (set by /Users/atsushi/.pyenv/version) anaconda3-5.1.0/envs/jupyter-env [~]$ pyenv global anaconda3-5.1.0/envs/jupyter-env