安装 superset

创建虚拟环境:

python -m venv msuperset

激活虚拟环境:

cd msuperset
source bin/activate

安装 superset

pip install superset

如果遇到报错:

  Running setup.py install for python-geohash ... error
Complete output from command /root/code/python/msuperset/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-szdbf0qe/python-geohash/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-omybv2pz-record/install-record.txt --single-version-externally-managed --compile --install-headers /root/code/python/msuperset/include/site/python3.6/python-geohash:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
copying geohash.py -> build/lib.linux-x86_64-3.6
copying quadtree.py -> build/lib.linux-x86_64-3.6
copying jpgrid.py -> build/lib.linux-x86_64-3.6
copying jpiarea.py -> build/lib.linux-x86_64-3.6
running build_ext
building '_geohash' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/src
gcc -pthread -B /root/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DPYTHON_MODULE=1 -I/root/code/python/msuperset/include -I/root/miniconda3/include/python3.6m -c src/geohash.cpp -o build/temp.linux-x86_64-3.6/src/geohash.o
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status 1 ----------------------------------------
Command "/root/code/python/msuperset/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-szdbf0qe/python-geohash/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-omybv2pz-record/install-record.txt --single-version-externally-managed --compile --install-headers /root/code/python/msuperset/include/site/python3.6/python-geohash" failed with error code 1 in /tmp/pip-build-szdbf0qe/python-geohash/

需要安装 gcc-c++

yum install gcc-c++

装完 gcc-c++ 后,再执行 pip install superset 应该就没问题了。

配置 superset

创建管理员用户

fabmanager create-admin --app superset

执行的时候会有这么一行提示:

fabmanager is going to be deprecated in 2.2.X, you can use the same commands on the improved 'flask fab <command>'

这是一个新的用法了,还没有研究

接着会让你输入用户名(username)、Fist Name、Last Name、邮箱地址、密码、重复密码。

如果遇到以下错误:

Was unable to import superset Error: cannot import name '_maybe_box_datetimelike'

原因是 pandas (在安装 superset 时会做为依赖被安装上)版本太高,需要卸载,再安装低版本的 pandas

pip install pandas==0.23.4

参考https://blog.csdn.net/kongxx/article/details/89006787

然后重新执行创建管理员用户的命令:

fabmanager create-admin --app superset

初始化数据库

superset db upgrade

如果遇到错误:

...
File "/root/code/python/msuperset/lib/python3.6/site-packages/sqlalchemy/orm/query.py", line 2572, in _join_determine_implicit_left_side
"Can't determine which FROM clause to join "
sqlalchemy.exc.InvalidRequestError: Can't determine which FROM clause to join from, there are multiple FROMS which can join to this entity. Try adding an explicit ON clause to help resolve the ambiguity.

说明 sqlalchemy 版本太高了,要降级 sqlalchemy

pip install sqlalchemy==1.2.18

参考https://github.com/apache/incubator-superset/issues/6977

载入测试数据

superset load_examples

初始化角色和权限

superset init

启动服务

端口号 8088,使用 -p 更改端口号

superset runserver

然后在浏览器中打开 http://localhsot:8088 就可以看到 superset 了

添加 mysql 数据源时出错

提示

ModuleNotFoundError: No module named 'MySQLdb'

因为 MySQLdb 是 python2 的产品。可使用 mysqlclient 方式代替。要安装 mysqlclient

先安装需要用到的系统依赖:

Ubuntu 下:

sudo apt-get install python3-dev libmysqlclient-dev

CentOS 下:

yum install python-devel mysql-devel

然后安装 mysqlclient

pip install mysqlclient


其它错误

...
In file included from sasl/saslwrapper.cpp:254:0:
sasl/saslwrapper.h:22:10: fatal error: sasl/sasl.h: No such file or directory
#include <sasl/sasl.h>
^~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

安装 libsasl2-dev

ubuntu

apt-get install libsasl2-dev

centos

yum -y install cyrus-sasl cyrus-sasl-devel cyrus-sasl-lib

其它操作参考:

轻量级BI工具Superset的搭建与使用

官方安装说明

安装使用 superset的更多相关文章

  1. 一、下载安装superset

    1.环境介绍: 操作系统:Windows 10 python版本:3.73 2.创建虚拟环境: 打开命令行窗口,使用安装python自带的pip命令,下载pinenv 虚拟环境工具, pip inst ...

  2. superset 安装配置

    一.配置python虚拟环境,请参考 superset依赖python3.6环境 https://www.cnblogs.com/xibuhaohao/p/9994854.html 二.安装配置sup ...

  3. 开源数据可视化BI工具SuperSet(安装)

    本次安装教程共分两大步骤,因为Superset 基于python3编写的web应用(flask) 所以要求python3环境,故首先要将linux系统自带的环境进行升级,已经是python3的可跳过- ...

  4. 二、初始化superset

    上一步成功安装了superset, 1.初始化数据 创建命令 #创建管理员账号fabmanager create-admin --app superset#cd到superset 根目录参考路径 C: ...

  5. superset链接本地mysql数据库

    刚安装好superset的时候大家都知道是用的其自动生成的sqllite数据库,如果我们想让器链接到自己数据库,给大家分享一下我的方法,以mysql为例: 1.安装好数据库mysql: $ sudo ...

  6. superset 错误解决

    访问superset localhost:8088   securety->list Role 报错 xxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxx ...

  7. 如何将Superset嵌入后台系统之实践

    1. 前言 此次实践过程全属个人学习,我选择了在window下安装Superset,并进行嵌入后台系统实践.对此进行实践过程总结,实践成果分享给大家,供大家参考,如果你有更好的想法,欢迎留言交流. 2 ...

  8. Apache Superset 1.2.0教程 (二)——快速入门(可视化王者英雄数据)

    上一篇我们已经成功的安装了superset,那么该如何可视化我们的数据呢?本文将可视化王者英雄的数据,快速的入门Superset. 一.连接数据源 首先确保mysql可以正常连接使用,并且准备好数据. ...

  9. Apache Superset 1.2.0教程 (三)—— 图表功能详解

    通过之前章节的学习,我们已经成功地安装了superset,并且连接mysql数据库,可视化了王者英雄的数据.使用的是最简单Table类型的图表,但是superset还支持非常多的图表类型. 本文我们将 ...

随机推荐

  1. Java之IO模型

    首先来看一下同步与异步的概念: 1.同步是指当前端发起一次操作请求时,只有后台执行完所有的代码操作才会给前端返回值. 2.异步是将前端发回的消息加入消息队列,并且立刻给前端返回请求,告诉用户可以离开当 ...

  2. 2019年上半年收集到的人工智能AutoML干货文章

    2019年上半年收集到的人工智能AutoML干货文章 自动机器学习简述(AutoML) 谷歌将AutoML应用于Transformer架构,翻译结果飙升,已开源 IBM推出AutoAI,让企业人工智能 ...

  3. DOJO之gridx

    GridX简介 Gridx是IBM公司的职员对Dojo中的Grid进行进一步扩展的组件,但是它是重新开发了Grid而不是继承Grid. 虽然同样都是基于Dojo store, 但与DataGrid/E ...

  4. [20190520]exp imp on th fly.txt

    [20190520]exp imp on th fly.txt --//以前做的测试,查找浪费许多时间,做1个记录.--//注:仅仅linux 操作系统,bash shell版本不能太低就可以实现,现 ...

  5. shell脚本模板----自动生成开头注释信息

    每当我们新建一个shell脚本都要去写一些繁琐的注释信息,这会浪费掉我们很多的时间,有没有感觉很痛苦呢? 哈哈 下面给大家分享一个shell脚本的模板文件,把它拷贝到用户的家目录下并命名成  .vim ...

  6. Firefox 与 geckodriver 版本兼容问题

    打开 python shell,执行以下脚本: from selenium import webdriverdriver = webdriver.Firefox()driver.maximize_wi ...

  7. B/S架构与C/S架构(略讲)

    B/S架构基本概念 B/S是Browser/Server,即浏览器/服务器架构.Browser指的是Web浏览器,极少数事务逻辑在前端实现,但主要事务逻辑在服务器端实现. B/S三层体系结构可以定义为 ...

  8. 4.Java基础_Java类型转换

    import javax.swing.plaf.synth.SynthMenuBarUI; /* 类型转换 自动类型转换: 把一个表示数据范围小的数值或者变量赋值给另一个表示数据范围大的变量 强制类型 ...

  9. 2. Linux文件与目录管理

    一.目录与路径 1. 相对路径与绝对路径 绝对路径:路径写法[一定由根目录 / 写起],如:/usr/share/doc 相对路径:路径写法[不由 / 写起], /usr/share/doc 要到 / ...

  10. zabbix使用钉钉告警

    1.钉钉创建群 2.[root@localhost ~]# vim /etc/zabbix/zabbix_server.conf # 配置文件中查找”Alert”查看告警脚本存放路径 [root@lo ...