Windows下快速搭建Superset使用环境

新建虚拟环境

可使用virtualenv/conda两种方式:

  1. virtualenv
1
2
3
4
mkdir supersettmp
cd supersettmp
virtualenv supersetenv
env\Scripts\activate
  1. conda
1
2
3
4
mkdir supersettmp
cd supersettmp
conda create -n supersetenv python=3.6
activate supersetenv

安装特殊包

windows下有些包需要特殊安装(sasl, geohash),手动下载并安装:

1
2
pip install d:\sasl-0.2.1-cp36-cp36m-win_amd64.whl
pip install d:\python_geohash-0.8.5-cp36-cp36m-win_amd64.whl

安装superset

1
pip install superset -i https://pypi.douban.com/simple

问题1:Was unable to import superset Error: cannot import name ‘_maybe_box_datetimelike

原因:pandas版本不一致

解决方案:https://github.com/apache/incubator-superset/issues/6770

1
2
3
pip list | grep pandas
pip uninstall pandas
pip install pandas==0.23.4

问题2:could not create ‘build\bdist.win-amd64\wheel.\superset\static\assets\dist\vendors-deckgl\layers\arc-deckgl\layers\geojson-deckgl\layers\grid-deckgl\layers\hex-deckgl\layers\p-39b91eb9.81565bc93ff56be4e334.chunk.js’: No such file or directory

原因:路径超过260个字符(超过windows的限制),https://github.com/apache/incubator-superset/issues/6440

解决方案:https://www.howtogeek.com/266621/how-to-make-windows-10-accept-file-paths-over-260-characters/

初始化数据

1
2
3
4
5
6
7
8
9
10
11
12
13
#初始化admin账号
fabmanager create-admin --app superset --username admin --firstname bi --lastname ocean --email [email protected] --password 123456
#virtualenv方式
cd F:\supersettmp\env\Lib\site-packages\superset\bin
#conda方式
#cd ...\Anaconda3\envs\superset\Lib\site-packages\superset\bin
python superset db upgrade
python superset load_examples
python superset init
python superset runserver -d -p 8079

启动

1
http://localhost:8079

坚持原创技术分享,您的支持将鼓励我继续创作!