fbprophet0.6安裝,實測成功

Prophet安裝教程

步驟:

可以在Centos機器或者虛擬機中, 選擇用相同版本的python解釋器,進行下載

Pip download fbprophet==0.6 -I 下載源

下載源可以是如下幾種選用

清華:https://pypi.tuna.tsinghua.edu.cn/simple(比較常用,親測速度很快)

 

阿里雲:http://mirrors.aliyun.com/pypi/simple/

 

中國科技大學 https://pypi.mirrors.ustc.edu.cn/simple/

 

華中理工大學:http://pypi.hustunique.com/

 

山東理工大學:http://pypi.sdutlinux.org/

 

豆瓣:http://pypi.douban.com/simple/

 

問題:

安裝過程中提示如下的問題,看問題分析和解決錯誤,結果正常安裝了

error: command 'gcc' failed with exit status

錯誤信息如下:

Fail to install fbprophet:INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_861b75c6337e237650a61ae58c4385ef NOW. error: command 'gcc' failed with exit status #1057

問題分析:

This usually means that the C++ compiler isn't hooked up correctly to PyStan. PyStan will successfully install even if it is not able to function correctly.

 

You can use this code to check that pystan is working (which I'm pretty sure it is not):

 

import pystan

model_code = 'parameters {real y;} model {y ~ normal(0,1);}'

model = pystan.StanModel(model_code=model_code)  # this will take a minute

y = model.sampling(n_jobs=1).extract()['y']

y.mean()  # should be close to 0

The reason it isn't working is because CentOS 7 does not support C++14, which is a new requirement for the latest version of PyStan. The solution is to downgrade to PyStan 2.18: stan-dev/pystan#583 , or upgrade from CentOS 7 to a newer OS.

 

處理措施:

The solution is to downgrade to PyStan 2.18

測試結果:

問題解決

 

安裝包參考如下:

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章