LoginSignup
14
13

More than 5 years have passed since last update.

pyenv環境でAnacondaを使う

Last updated at Posted at 2016-12-02

最近 ゼロから作るDeep Learning でDeep Learningの勉強をはじめました。

その過程で NumPy や Matplotlib などのデータ分析系のライブラリが使えるディストーションである Anaconda の環境を用意する必要があり、本では Anaconda公式ページ からインストールシェルを使ってインストールするように書いてありますが、私は pyenv を使いたかったので、そのとき行った手順を書きます。

といってもめっちゃ簡単で、以下を実行するだけです。
※pyenvはインストール済みの前提

$ pyenv install anaconda3-4.0.0

anaconda3-4.0.0環境をactivateする

$ pyenv activate anaconda3-4.0.0

(anaconda3-4.0.0) $ pip list
alabaster (0.7.7)
anaconda-client (1.4.0)
anaconda-navigator (1.1.0)
...
numpy (1.10.4)
...
matplotlib (1.5.1)
...

本当はvirtualenv環境を作りたかったのですが、以下のようにしても numpy などのライブラリがコピーされなかったので仕方なく上記のやり方にしています。

$ pyenv virtualenv anaconda3-4.0.0 deeplearning

$ pyenv activate deeplearning

(deeplearning) $ pip list
pip (9.0.1)
setuptools (27.2.0)
wheel (0.29.0)

やり方ご存知の方いたら教えてください。

2017/04/04 追記

anacondaではcondaコマンドを使ってvirtualenv環境を作るようですね。

$ conda create -n deeplearning anaconda

$ source activate deeplearning
もしくは
$ pyenv activate anaconda3-4.0.0/envs/deeplearning
14
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
13