LoginSignup
2
3

Prophet on Miniconda on Windows10

Last updated at Posted at 2017-11-22

前提条件

「極力CUIでゼロからDjango開発環境を構築」と同様の手順を実行して、PowershellまたはターミナルでMiniconda 3が使用できるようになっていること

仮想環境を作成して有効化

(base) PS> conda create -n prophet-test
(base) PS> conda activate prophet-test
(prophet-test) PS>

Mac ターミナル の場合

(base) $ conda create -n prophet-test
(base) $ source activate prophet-test
(prophet-test) $
  • Windows では `conda` なのに Mac では `source`
  • `prophet-test`は任意の文字列に置き換えできる
  • 右端の()の中が現在な仮想環境

Prophetをインストール

(prophet-test) PS> conda install -c conda-forge fbprophet

参考: https://facebook.github.io/prophet/docs/installation.html
この1コマンドで関連ライブラリがconda-forgeからインストールされ、最後にProphetがインストールされる。

ストーリー

pipを使用してpystanやprophetを以下のようにインストールしてみたが、上手く行かなかった。

(prophet-test)> conda install numpy matplotlib pandas
(prophet-test)> pip install -U pystan
(prophet-test)> pip install -U fbprophet

ここで Successful installing という表示は出た。
しかしコーディングを始めると、AttributeError が発生してコードが正常に実行されない。
pip install -U pystanconda install pystanに変えてもダメだった。
そこで、https://facebook.github.io/prophet/ を見ていたらWindowsとLinuxに並んでAnacondaの記述を発見。

Use conda install gcc to set up gcc. The easiest way to install Prophet is through conda-forge: conda install -c conda-forge fbprophet.

ということは、

(prophet-test)> conda install numpy matplotlib pandas
(prophet-test)> conda install gcc
(prophet-test)> conda install -c conda-forge fbprophet
(prophet-test)> pip install pystan
(prophet-test)> pip install fbprophet

でよさそう。

The major dependency that Prophet has is pystan. PyStan has its own installation instructions.
https://pystan.readthedocs.io/en/latest/installation_beginner.html

を見るとWin とMacでC言語関連のインストール方法が違うらしい。これによって、Pystanのインストール手順に差が生まれる模様。

Excelsior!

2
3
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
2
3