pyenv/vietualenvにminicondaをインストールする。
[ccNe lang=”bash” theme=”blackboard”]pyenv install miniconda3-4.3.30[/ccNe]
virtualenv/miniconda環境を構築する。
[ccNe lang=”bash” theme=”blackboard”]pyenv virtualenv miniconda3-4.3.30 caffe2[/ccNe]
virtualenv/miniconda環境のcaffe2をアクティベートする。
[ccNe lang=”bash” theme=”blackboard”]pyenv activate caffe2[/ccNe]
caffe2はvirtualenvじゃないとアクティベートされない。
[ccNe lang=”bash” theme=”solarized-light”]pyenv-virtualenv: version `caffe2′ is not a virtualenv[/ccNe]
このエラーは以下のようにsymbolic linksを付け加えれば解決される。
[ccNe lang=”bash” theme=”blackboard”]ln -s ~/.pyenv/versions/miniconda3-4.3.30/bin/activate ~/.pyenv/versions/miniconda3-4.3.30/envs/caffe2/bin/
ln -s ~/.pyenv/versions/miniconda3-4.3.30/bin/conda ~/.pyenv/versions/miniconda3-4.3.30/envs/caffe2/bin/[/ccNe]
[cciNe lang=”bash” theme=”blackboard”]pyenv activate caffe2[/cciNe]→[cciNe lang=”bash” theme=”blackboard”](caffe2) root@5c44cdd9b123:~/[/cciNe]
[cciNe lang=”bash” theme=”blackboard”]pyenv deactivate[/cciNe]でcaffe2環境から抜け出せる。
