Superset_安裝指南
參考文檔
- http://blog.csdn.net/qq273681448/article/details/75050513
- https://superset.incubator.apache.org/installation.html#getting-started
- https://zhuanlan.zhihu.com/p/28485468
安裝虛擬環(huán)境
Superset同時支持Python2和Python3, 我這里以Python3作為演示萄金。它支持pip形式的下載简僧,不過我不建議直接安裝腿准,因為Superset的依賴包較多,如果直接安裝,很容易和現(xiàn)有的模塊產(chǎn)生沖突。
這里需要先搭建Python的虛擬環(huán)境。虛擬環(huán)境可以幫助我們在單機(jī)上建立多個版本的Python榨乎。簡而言之,即可以Python2和Python3共存瘫筐,也能Python3.3蜜暑、3.4、3.5共濟(jì)一堂严肪,彼此間互相獨立史煎。
pip install virtualenv
激活虛擬環(huán)境
# virtualenv is shipped in Python 3 as pyvenv
virtualenv venv
. ./venv/bin/activate
使用virtualenv搭建python3開發(fā)環(huán)境
參考文檔:
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