Python全系列 教程
3567个小节阅读:5930.9k
目录
鸿蒙应用开发
C语言快速入门
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
为itbaizhan用户添加sudo权限
xxxxxxxxxx
[root@node4 ~]# chmod u+w /etc/sudoers
[root@node4 ~]# vim /etc/sudoers
root ALL=(ALL) ALL
#添加
itbaizhan ALL=(ALL) ALL
[root@node4 ~]# chmod u-w /etc/sudoers
安装SuperSet之前安装基础依赖
xxxxxxxxxx
[root@node4 ~]# su itbaizhan
[itbaizhan@node4 ~]# sudo yum install -y gcc gcc-c++ libffi-devel python-devel python-pip python-wheel python-setuptools openssl-devel cyrus-sasl-devel openldap-devel
[sudo] itbaizhan 的密码:itbaizhan
[itbaizhan@node4 ~]# sudo yum install -y dnf
[itbaizhan@node4 ~]# sudo dnf install -y gcc gcc-c++ libffi-devel python3-devel python3-pip python3-wheel openssl-devel cyrus-sasl-devel openldap-devel
安装/更新setuptools和pip
xxxxxxxxxx
[itbaizhan@node4 ~]# conda activate superset
(superset) [itbaizhan@node4 ~]# pip install --upgrade setuptools pip -i https://pypi.tuna.tsinghua.edu.cn/simple
# 查看setuptools版本
(superset) [itbaizhan@node4 ~]$ pip list|grep setuptools
setuptools 67.6.0
#如果大于65.5.0,需要将setuptools降为65.5.0版本即可,避免:cannot import name 'Log' from 'distutils.log'
(superset) [itbaizhan@node4 ~]# pip install setuptools==65.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
(superset) [itbaizhan@node4 ~]$ pip list|grep setuptools
setuptools 65.5.0
安装Superset
xxxxxxxxxx
(superset) [root@node4 ~]# pip install apache-superset==2.0.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
添加环境变量:
xxxxxxxxxx
(superset) [itbaizhan@node4 ~]# export FLASK_APP=superset
初始化superset
xxxxxxxxxx
(superset) [itbaizhan@node4 ~]# superset db upgrade
可能出现错误提示:ModuleNotFoundError: No module named 'cryptography.hazmat.backends.openssl.x509'
xxxxxxxxxx
(superset) [itbaizhan@node4 ~]$ pip list|grep cryptography
cryptography 39.0.2
现有cryptography版本不兼容,需要安装3.3.2
xxxxxxxxxx
(superset) [itbaizhan@node4 ~]$ pip uninstall cryptography
(superset) [itbaizhan@node4 ~]$ pip install cryptography==3.3.2 -i https://pypi.tuna.tsinghua.edu.cn/simple
(superset) [itbaizhan@node4 ~]$ pip list|grep cryptography
cryptography 3.3.2
(superset) [itbaizhan@node4 ~]# superset db upgrade
错误提示:ModuleNotFoundError: No module named 'werkzeug.wrappers.etag'
这个是在 superset 2.0 版本出现的bug,通过降低Werkzeug的版本解决
xxxxxxxxxx
(superset) [itbaizhan@node4 ~]$ pip list|grep Werkzeug
Werkzeug 2.2.3
(superset) [itbaizhan@node4 ~]$ pip uninstall -y Werkzeug
(superset) [itbaizhan@node4 ~]$ pip uninstall -y Flask
(superset) [itbaizhan@node4 ~]$ pip install Flask==2.0.3 -i https://pypi.tuna.tsinghua.edu.cn/simple
(superset) [itbaizhan@node4 ~]$ pip install Werkzeug==2.0.3 -i https://pypi.tuna.tsinghua.edu.cn/simple
(superset) [itbaizhan@node4 ~]# rm -f .superset/superset.db
(superset) [itbaizhan@node4 ~]# superset db upgrade
错误提示:ModuleNotFoundError: No module named 'wtforms.ext'
,为WTForms 3.0的版本去掉了ext,需要降低WTForms的版本到2.3.3
xxxxxxxxxx
(superset) [itbaizhan@node4 ~]$ pip list|grep WTForms
WTForms 3.0.1
WTForms-JSON 0.3.5
(superset) [itbaizhan@node4 ~]$ pip uninstall -y WTForms
(superset) [itbaizhan@node4 ~]$ pip install WTForms==2.3.3 -i https://pypi.tuna.tsinghua.edu.cn/simple
(superset) [itbaizhan@node4 ~]# rm -f .superset/superset.db
(superset) [itbaizhan@node4 ~]# superset db upgrade
创建管理员账户
xxxxxxxxxx
(superset) [root@node4 ~]# superset fab create-admin
Username [admin]: itbaizhan
User first name [admin]: it
User last name [user]: baizhan
Email [admin@fab.org]: xflovejava@126.com
Password: #itbaizhan
Repeat for confirmation:
初始化Superset
xxxxxxxxxx
(superset) [root@node4 ~]# superset init