上個月參加 IBM 的云計算論壇,其中其最大的特點就是 IBM整合了市面上幾乎大部分跟機器學習和數據分析 及數據科學相關的開源項目,打造出自己的平臺,不過也可以看得出在開源力量的影響下,IBM 這個昔日的巨人好像有點力不從心,不過總說瘦死的駱駝比馬大,IBM只要還打算茍活,只要戰略 親民,向開源項目媾和,依然可以活的很滋潤
自然我在大會上看到的和體驗到的就是 Jupyter 和Zeppelin 這兩個web 端 language notebook的強大之處,確實驚艷到了,之前參加一些量化投資的網站,比如優礦,在線可以使用python編程,當時也讓我很驚訝,不過對于java 重量級,估計要等到 java9 沒準可以實現
1.Mac 安裝 Zeppelin
其實mac安裝 Zeppelin超級簡單,在 homebrew的可視化 cakebrew下 搜索zeppelin即可 下載安裝,安裝后
$ ./bin/zeppelin-daemon.sh start
開啟 zeppelin的后臺保衛程序
我安裝的的是0.7版本,但是如果想在 web瀏覽器看到 zeppelin還是需要下一步
進入 zeppelin的安裝目錄,會看到 zeppelin-web-0.7.war ,這個war 包需要放到 tomcat的 webapps目錄下 并啟動tomcat ,才可以 在瀏覽器看到 zeppelin 的web 界面
Zeppelin 相當強大,支持的語言和dsl很多,其中R語言可以由 spark.r 環境執行
2.Mac 安裝 Jupyter
Jupyter 從 拼寫中就可以看到python的影子,所以安裝Jupyter也是通過python的,因為Jupyter-client依賴 Anaconda,
pip3 install Jupyter
安裝成功后,啟動Jupyter
jupyter notebook
jupyter 默認支持 Julia和Python 3,默認不支持R【這個是我安裝好R插件后的截圖】
這個時候 mac 電腦本地需要安裝 R 語言 ,我安裝 3.4版本。
https://cran.rstudio.com/bin/macosx/R-3.4.0.pkg
還可以安裝 Rstudio
https://download1.rstudio.org/RStudio-1.0.143.dmg
安裝好后,在github找到 jupyter的R插件
https://github.com/IRkernel/IRkernel
發現 根據安裝向導,還是有問題,報錯,根據網絡中找到的資料來看
在其issue中找到了答案
https://github.com/IRkernel/IRkernel/issues/469
首先呢 先安裝 jupyter-client 通過 anocanda 命令
(conda install -c anaconda jupyter_client=5.0.1)
然后 需要安裝下面的包,然后在 mac 的Terminal中操作 R
$ r
進入 R 環境
依賴的包 安裝好了,再安裝插件
command: >devtools::install_github('IRkernel/IRkernel') 10-Last but not least, type the following
command: >IRkernel::installspec()
這里有一些需要安裝的R語言的包
http://r.789695.n4.nabble.com/IRkernel-Installation-Issues-td4727884.html
1-Go to the page [https://irkernel.github.io/installation](https://irkernel.github.io/installation)2-Open the R console (I have R version 3.3.2) 3-Go to the step where it says "Installing via supplied binary packages (default on Windows + Mac OS X) 4-Instead of installing all the packages using one single command as suggested in the installation instructions, go to the R console and install all of the packages one by one, as follows
>install.packages('repr')
>install.packages('IRdisplay')
>install.packages('evaluate')
>install.packages('crayon')
>install.packages('pbdZMQ')
>install.packages('devtools')
>install.packages('uuid')
>install.packages('digest')
5-Connect to a CRAN mirror and select install packages, look for the package githubinstall and clic on it to install it 6-Start loading each one of the packages installed like this:
>library("repr")
>library("IRdisplay")
>library("evaluate")
>library("crayon")
>library("pbdZMQ")
>library("devtools")
>library("uuid")
>library("digest")
>library("githubinstall") 7-After this you have to update jsonlite which is a dependencie of package githubinstall, you update jsonlite using the following command: >update.packages('jsonlite') 8-After this, you have to type the following commands:
>library(httr)
>set_config(use_proxy(url="the required IP", port=8080, username="your network user", password="the password you use to unlock your computer")) >#you can get the required IP going to the command prompt and using the command ping >#port has to be 8080 9-type use the
總的來說,安裝還是非常便利,這幾天 windows爆發病毒,mac 沒有被波及,實屬幸運