安装环境:
- 系统: Centos7
- py版本:python3.6
- superset版本: 0.28.1
安装过程:
- 安装superset
pip install superset
之后你可能遇到类似以下这种报错,而且很多。这个是py库里没有这些包,你就缺啥包就 pip3 install xxx就行了
Was unable to import superset Error: No module named ‘wtforms_json’
其中
ModuleNotFoundError: No module named ‘geohash’
这个geohash报错的这个包是有bug的,你需要进去python3的lib包里有两个大写的有关Geohash的包改成小写,再次pip3 install geohash就可以了
还有安装过程中发现一个报错是因为pandas版本过高造成的,建议卸载当前pandas版本,安装pandas==0.23.4
以下版本号要特别注意:
pip3 install --upgrade werkzeug0.16.1
pip3 install flask-jwt-extended3.18.1
pip3 install flask0.12.5
pip3 install superset0.28.1
pip3 install pandas==0.23.4
注意superset的版本要选择0.28.1,版本选择不对会在后边报:
auth_type.get(_appbuilder.sm.auth_type, “No Auth method”)的异常;
注意pandas的版本要选择0.23.4,版本不要选择高版本,不然后面会报错
- 账号密码
执行 fabmanager create-admin --app superset
这个过程会提示输入用户名,密码等。注意前三个用户名不要使用一样的,不然因为不同用户权限都使用同一个用户会报错
- 初始化数据库
执行 superset db upgrade
如果执行不成功,可能因为第二部账号密码操作错误导致,最简单办法删库重新来。
rm -rf ~/.superset/superset.db
- 启动superset:
执行 superset runserver -p 5000 &
- 登录superset
输入URL:http://IP:5000
连接ClickHouse:
打开这个页面,输入ClickHouse的URL,格式为
clickhouse://username:password@ip:8123/database
这里会有一个报错很鸡儿蛋疼
sqlalchemy.exc.NoSuchModuleError: Can’t load plugin: sqlalchemy.dialects:clickhouse
这个报错网上说下载py里的sqlalchemy连接clickhouse插件,这个没错,但是sqlalchemy版本号可能有问题
这里SQLAlchemy包的版本一定要选高版本的。。。
别问我为什么
我挨个版本试出来的
报错:DB::Exception: default: Authentication failed: password is
incorrect or there is no user with such name
这个报错不是因为账号密码不对,又是因为包版本号问题
这里需要把infi.clickhouse_orm降级
pip3 install infi.clickhouse_orm==1.0.4