Superset_安装指南
参考文档
- http://blog.csdn.net/qq273681448/article/details/75050513
- https://superset.incubator.apache.org/installation.html#getting-started
- https://zhuanlan.zhihu.com/p/28485468
安装虚拟环境
Superset同时支持Python2和Python3, 我这里以Python3作为演示。它支持pip形式的下载,不过我不建议直接安装,因为Superset的依赖包较多,如果直接安装,很容易和现有的模块产生冲突。
这里需要先搭建Python的虚拟环境。虚拟环境可以帮助我们在单机上建立多个版本的Python。简而言之,即可以Python2和Python3共存,也能Python3.3、3.4、3.5共济一堂,彼此间互相独立。
pip install virtualenv
激活虚拟环境
# virtualenv is shipped in Python 3 as pyvenv
virtualenv venv
. ./venv/bin/activate
使用virtualenv搭建python3开发环境
参考文档:
https://www.cnblogs.com/MikeZhang/p/virtualenvPython_20150607.html
安装最新依赖工具
pip install --upgrade setuptools pip
正式开始安装superset
# Install superset
pip install superset
# Create an admin user (you will be prompted to set username, first and last name before setting a password)
fabmanager create-admin --app superset
# Initialize the database
superset db upgrade
# Load some data to play with
superset load_examples
# Create default roles and permissions
superset init
# Start the web server on port 8088, use -p to bind to another port
superset runserver
# To start a development web server, use the -d switch
# superset runserver -d
Superset汉化
- 编辑supers配置文件
切换到superset安装目录
cd /usr/lib/python2.7/site-packages/superset/
编辑config.py文件
Babel config for translations处更改为:
# ---------------------------------------------------
# Babel config for translations
# ---------------------------------------------------
# Setup default language
BABEL_DEFAULT_LOCALE = 'zh'
# Your application default translation path
BABEL_DEFAULT_FOLDER = 'babel/translations'
# The allowed translation for you app
LANGUAGES = {
'en': {'flag': 'us', 'name': 'English'},
'it': {'flag': 'it', 'name': 'Italian'},
'fr': {'flag': 'fr', 'name': 'French'},
'zh': {'flag': 'cn', 'name': 'Chinese'},
}
- 下载superset语言文件
https://github.com/ApacheInfra/superset/blob/master/superset/translations/zh/LC_MESSAGES/messages.po
下载完成后,将文件放在下面的目录下
/usr/lib64/python2.7/site-packages/flask_appbuilder/translations/zh/LC_MESSAGES/messages.po - 编译messages.po文件
pybabel compile -d translations - 重启superset,简单汉化完成。
深度汉化参考文档
http://blog.csdn.net/zql898626913/article/details/75411810?locationNum=8&fps=1
网友评论