superset : 0.36
Python: 3.6.0
一. 从git下载superset0.36.0的压缩包incubator-superset-0.36.0.zip
下载后解压到/usr/local/lib/python3.6/site-packages/incubator-superset-master
二. 安装扩展依赖,及开发依赖(这里指定豆瓣源)
进入到目录
cd
/usr/local/lib/python3.6/site-packages/incubator-superset-master
安装依赖
easy_install pytest-runner
安装依赖
pip install -r requirements.txt -i https://pypi.douban.com/simple/
安装开发依赖
pip install -r requirements-dev.txt -i https://pypi.douban.com/simple/
三. 安装superset
pip install -e .
四.初始化
修改config.py,将数据库改成superset036.db
SQLALCHEMY_DATABASE_URI = "sqlite:///" + os.path.join(DATA_DIR, "superset036.db")
初始化数据库
superset db upgrade
创建管理员权限和密码
superset fab create-admin
初始化角色和权限
superset init
yarn install cross-env
yarn install datatables.net-bs
前端编译步骤:
1.安装nodejs,查看版本发现已安装。
node --version
v8.10.0
2.查看版本发现已安装。
npm --version
3.5.2
3.安装node管理工具n,安装新node,更新对应的npm。
安装node管理工具n
npm install -g n
安装稳定版node
n stable
查看已安装node
n
全局安装npm
npm -g install npm@6.14.4
创建软连接,需先删除原来的/usr/bin/npm链接
ln -s /usr/local/n/versions/node/12.17.0/bin/npm /usr/bin/npm
4.修改babel.config.js,添加下面两行将loose设置为true.
['@babel/plugin-proposal-private-methods', { 'loose': true }],
['@babel/plugin-proposal-class-properties', { 'loose': true }],
5.#npm永久设置成淘宝源
npm config set registry https://registry.npm.taobao.org
6.npm install -d
7.npm run build
8.npm run dev
异常处理:
ERROR in /usr/local/lib/python3.6/site-packages/incubator-superset-master/superset-frontend/src/components/ListView/TableCollection.tsx
ERROR in /usr/local/lib/python3.6/site-packages/incubator-superset-master/superset-frontend/src/components/ListView/TableCollection.tsx(45,22):
TS2339: Property 'hidden' does not exist on type 'HeaderGroup<{}>'.
ERROR in /usr/local/lib/python3.6/site-packages/incubator-superset-master/superset-frontend/src/components/ListView/TableCollection.tsx
ERROR in /usr/local/lib/python3.6/site-packages/incubator-superset-master/superset-frontend/src/components/ListView/TableCollection.tsx(48,28):
TS2339: Property 'sortable' does not exist on type 'HeaderGroup<{}>'.
ERROR in /usr/local/lib/python3.6/site-packages/incubator-superset-master/superset-frontend/src/components/ListView/TableCollection.tsx
ERROR in /usr/local/lib/python3.6/site-packages/incubator-superset-master/superset-frontend/src/components/ListView/TableCollection.tsx(54,27):
TS2339: Property 'sortable' does not exist on type 'HeaderGroup<{}>'.
ERROR in /usr/local/lib/python3.6/site-packages/incubator-superset-master/superset-frontend/src/components/ListView/TableCollection.tsx
ERROR in /usr/local/lib/python3.6/site-packages/incubator-superset-master/superset-frontend/src/components/ListView/TableCollection.tsx(85,33):
TS2339: Property 'hidden' does not exist on type 'ColumnInstance<{}>'.
ERROR in /usr/local/lib/python3.6/site-packages/incubator-superset-master/superset-frontend/src/components/ListView/TableCollection.tsx
ERROR in /usr/local/lib/python3.6/site-packages/incubator-superset-master/superset-frontend/src/components/ListView/TableCollection.tsx(87,53):
TS2339: Property 'cellProps' does not exist on type 'ColumnInstance<{}>'.
error Command failed with exit code 2.
解决方法:修改TableCollection.tsx文件。
修改44行,修改前
{headerGroup.headers.map(column =>
修改后
{headerGroup.headers.map((column:any) =>
修改82行,修改前
{row.cells.map(cell:any => {
修改后
{row.cells.map((cell:any) => {
网友评论