zeppelin支持matplotlib配置

我的环境: python 2.7.10, zepplin 0.61

1. 需要python支持Tkinter. 这需要重新编译安装python

先查询系统中tk的版本:

[root@n2 ~]# rpm -qa | grep tk
tk-devel-8.5.7-5.el6.x86_64
tkinter-2.6.6-66.el6_8.x86_64
tk-8.5.7-5.el6.x86_64


下载python2.7.10源码,修改Modules/Setup.dist, 去掉如下所示的注释, 并修改tk的版本为8.5:

.......

# *** Always uncomment this (leave the leading underscore in!):
 _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \
# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
        -L/usr/local/lib \
# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
        -I/usr/local/include \
# *** Uncomment and edit to reflect where your X11 header files are:
        -I/usr/X11R6/include \
# *** Or uncomment this for Solaris:

.......

# *** Uncomment and edit to reflect your Tcl/Tk versions:
        -ltk8.5 -ltcl8.5 \

......


2.  安装pip

因为自己编译的python不带有pip,我下的pip版本是 9.0.1.

下载pip,然后解压后进入pip目录,运行 python setup.py install安装pip


3. 安装libpng

我是下载  libpng-1.6.26.tar.xz 后,解压再 make install


4. 安装freetype

我是下载 freetype-2.6.5.tar.gz 后, 解压再 make install


5. 安装 matplotlib 1.5.0

 pip --no-cache-dir install -U -i https://pypi.mirrors.ustc.edu.cn/simple matplotlib==1.5.0

注意:我一开始使用默认最新的1.5.3版本安装后,无法使用!


6. 安装 py4j

pip install py4j


5. 重启zeppelin,搞定!

注意: 以上步骤需要root 权限或者sudo.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值