Mac 安装Zeppelin 和jupyter 及jupyter的R插件

上个月参加 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
Paste_Image.png

Paste_Image.png

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() 
Paste_Image.png

这里有一些需要安装的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 没有被波及,实属幸运








最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容