Apache Superset从入门到放弃(基于python3.6.9)
Superset 0.38.1?安裝配置
Superset簡介
Superset?是一款由 Airbnb 開源的“現代化的企業級 BI(商業智能) Web 應用程序”,其通過創建和分享 dashboard,為數據分析提供了輕量級的數據查詢和可視化方案。
安裝
該安裝基于apache superset 0.38.1,應用在Ubutun 18.04.5 LTS之上,python 3.6.9
Pip3 21.3.1。
準備pip3
?????? 1 首先python3 里安裝pip3
可參考 Python3中安裝pip3 - cloudolt - 博客園。
?????? 其中 缺少ModuleNotFoundError: No module named 'distutils.util'。錯誤見下:
按照如下方法解決
?????? apt-get install python3-distutils
?????? 2 升級pip3
?????? pip3 install --upgrade setuptools pip
配置虛擬環境
pip3 install virtualenv -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
apt-get install python3-venv
cd /root/software/supersethome
python3 -m venv venv
. venv/bin/activate
pip安裝Superset
pip3 install apache-superset -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
contextlib2-0.6.0.post1-py2.py3-none-any.whl
pip3 install croniter-0.3.36-py2.py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install typing_extensions-3.6.6-py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install celery-4.4.7-py2.py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install setuptools-rust -i http://pypi.douban.com/simple --trusted-host pypi.douban.
(venv) root@slave2:~/software/supersethome# pip3 install cachelib-0.1.1-py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
https://pypi.org/project/marshmallow-sqlalchemy/0.22.0/#files 下載地址
pip3 install click==7.1.2 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install Werkzeug==2.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install Jinja2==3.0.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install Flask-Login==0.3.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install Flask-SQLAlchemy==2.4.0? -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
#pip3 install Flask-OpenID==1.2.5?? -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install Flask_OpenID-1.3.0-py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install Flask-WTF==0.14.2 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install marshmallow_sqlalchemy-0.22.0-py2.py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install colorama==0.3.9 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install idna-2.0-py2.py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install jsonschema==3.0.1 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install Flask_AppBuilder-3.0.1-py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install flask==1.1.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install flask_talisman-0.8.0-py2.py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install Flask_Migrate-3.0.0-py2.py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install dnspython-1.15.0-py2.py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install email_validator-1.0.5-py2.py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install Flask_Babel-1.0.0-py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install apispec==3.3.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install PyYAML==3.10.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install flask-appbuilder==3.0.1? -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install geopy-2.1.0-py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install Flask_Compress-1.10.0-py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install gunicorn==20.0.2 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install markdown==3.0.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install isodate-0.6.0-py2.py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install msgpack==1.0.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install pandas==1.1.2 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install humanize-3.13.1-py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install pathlib2==2.3.6 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install parsedatetime==2.6.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install python-dotenv==0.19.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?Python.h: No such file or directory的解決方法可參見如下:
https://blog.csdn.net/JLinkTwo/article/details/87917504
即安裝Python3開發包
sudo apt-get install python3-dev
ll /usr/include/python3.6m/ 里會出現Python.h
?pip3 install python-geohash==0.8.5 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install charset-normalizer==2.0.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install idna-ssl==1.0.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install slackclient==2.5.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install bleach==3.0.2 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install flask-appbuilder==3.0.1 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install retry-0.9.2-py2.py3-none-any.whl -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install pyarrow==1.0.1 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?simplejson-3.16.0.tar.gz 源碼安裝
?SQLAlchemy-Utils-0.36.8.tar.gz 源碼安裝
?pip3 install sqlparse==0.3.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?WTForms-JSON-0.3.3.tar.gz 源碼安裝
?pip3 install urllib3==1.26.6 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?pip3 install pycparser==2.21.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
#安裝RUST編譯器
apt install rustc
pip3 install apache-superset -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 installcryptography=36.0.1 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install pyyaml==5.1.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install selenium==3.141.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install polyline==1.4.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
Installing collected packages: cryptography, flask-caching, polyline, pyyaml, selenium, apache-superset
初始化
pwd
/root/software/supersethome
cd venv/bin/
superset db upgrade
注:初始化時一些包報錯后由重新安裝了部分低版本的包。
解決方法:
pip3 install PyJWT==1.7.1 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
?File "/root/software/supersethome/venv/lib/python3.6/site-packages/flask_wtf/recaptcha/widgets.py", line 5, in <module>
??? from werkzeug import url_encode
ImportError: cannot import name 'url_encode'
pip3 install werkzeug==0.16.0 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install WTForms==2.3.3 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install sqlalchemy-utils==0.36.6? -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip3 install sqlalchemy==1.3.16 -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
初始化賬號信息
$ export FLASK_APP=superset
superset fab create-admin
加載樣例
superset load_examples
初始化
superset init
啟動服務
superset run -h 0.0.0.0 -p 8088 --with-threads --reload –debugger
注:這里-h 0.0.0.0是可以讓外網訪問,不加則只能loacalhost訪問。
?引用的包
?
依賴包版本明細
以下摘錄自源碼。
支持的數據庫版本?
瀏覽器訪問
定義數據源
定義圖表
總結
以上是生活随笔為你收集整理的Apache Superset从入门到放弃(基于python3.6.9)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 出现信用卡逾期不还后果很严重 千万不要抱
- 下一篇: 通联支付是国企吗