OS
ubuntu 16.04 lts 64
1. 准备环境
#安装依赖
sudo apt-get install build-essential libssl-dev libffi-dev python-dev python-pip libsasl2-dev libldap2-dev
#升级pip
pip install -U pip
#安装virtualenv
pip install virtualenv
2. 从github上克隆代码到本地
git clone https://github.com/apache/incubator-superset
3. 将代码导入pycharm
- file --> open --> 选择克隆的代码目录 --> OK

- 设置项目的python解释器
file --> settings --> Project:incubator-superset -->Project Interpreter --> create VirtualEnv --> 输入环境名称并选择保存路径 --> OK -->OK




注意:完成虚拟环境的创建之后,你的IDE当中并不会像上图一样显示那么多的三方包,等我们完成下面的步骤之后便会像上图显示的一样了。
- 在incubator-superset/superset目录下新建run.py,添加如下内容:
from superset import app
app.run(debug=True, host='0.0.0.0', port=8088)
4. 安装和初始化
安装
(superset_env):~/pythonProjects/incubator-superset$ cd superset/assets/
(superset_env):~/pythonProjects/incubator-superset/superset/assets$
(superset_env):~/pythonProjects/incubator-superset/superset/assets$ npm install ## 如果觉得慢的话可以使用阿里的源,方法: npm config set registry https://registry.npm.taobao.org
(superset_env):~/pythonProjects/incubator-superset/superset/assets$ npm run prod
(superset_env):~/pythonProjects/incubator-superset/superset/assets$ cd ../..
(superset_env):~/pythonProjects/incubator-superset$ python setup.py develop
这个过程耗时可能相对久一些。
初始化
# Create an admin user (you will be prompted to set username, first and last name before setting a password)
(superset_env):~/pythonProjects/incubator-superset$ fabmanager create-admin --app superset
# Initialize the database
(superset_env):~/pythonProjects/incubator-superset$ superset db upgrade
# Load some data to play with
(superset_env):~/pythonProjects/incubator-superset$ superset load_examples
# Create default roles and permissions
(superset_env):~/pythonProjects/incubator-superset$ superset init
5. 运行
方法一:直接在pycharm中运行第三步时新建的run.py

访问superset


方法二:命令行启动
(superset_env):~/pythonProjects/incubator-superset$ superset runserver

参考文档:
这是小可第一篇网络博文,还望大家多多提意见。
网友评论