linux环境下superset源码编译安装文档--非pip安装

环境介绍

1.centos7
2.python3.6
3.superset-0.28.1

一.安装node.js,创建前端编译环境

1.使用以下curl命令启用Nodesource存储库

curl --silent --location https://rpm.nodesource.com/setup_10.x | bash -
setup_10.x此处可配置安装的版本号,建议安装10.x以上版本,否则编译胡出现诸多问题

2.执行下面命令安装Node.js,并安装cnpm淘宝镜像

sudo yum install nodejs
npm install -g cnpm --registry=https://registry.npm.taobao.org

3.可以顺手安装yarn(可以不用安装)。官方提供的Yarn存储库会经常被维护,为了保持最新版,我们在添加Yarn存储库源的时候需要导入存储库的GPG密钥

curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
sudo rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg

4.安装yarn

sudo yum install yarn

5.查看版本号

可以使用node -v,npm -v,yarn --version查看版本号

二.superset安装

1.github上下载源码

git clone https://github.com/apache/incubator-superset.git或者github上手动下载安装包解压

2.编译前端代码

cd incubator-superset-0.28.1/superset/assets
cnpm install -d
npm run build

3.前端编译完后,将incubator-superset-0.28.1/superset/static/ 目录下的assets链接文件删掉,将整个assets文件夹移动到incubator-superset-0.28.1/superset/static/目录下,并将assets文件夹下的node_modules和docs文件删掉

4.创建python虚拟环境

cd incubator-superset-0.28.1/
python -m venv venv3
. venv/bin/activate启动虚拟环境(deactivate退出虚拟环境)

5.安装superset依赖包

sudo yum upgrade python-setuptools
sudo yum install gcc gcc-c++ libffi-devel python-devel python-pip python-wheel openssl-devel libsasl2-devel openldap-devel
pip install -r requirements.txt

6.安装superset

python setup.py install

7.启动superset

fabmanager create-admin --app superset(创建管理员账户)
superset db upgrade(初始化数据库)
superset load_examples
superset init
superset runserver -p 5000

8.浏览器浏览ip:5000看到登录页面表示安装成功

三.出现的错误

一般错误都是python依赖包版本不匹配导致的错误,官方给出的requirements已经比较原始了,现在完全按照这个依赖装会出现依赖包不匹配的问题,根据报错提示解决一下即可。下面列出以下我自己的依赖文件。
alembic1.0.0 # via flask-migrate
amqp
2.3.2 # via kombu
asn1crypto0.24.0 # via cryptography
babel
2.6.0 # via flask-babel, flower
billiard3.5.0.4 # via celery
bleach
2.1.2
boto31.4.7
botocore
1.7.48
cchardet1.1.3 # via tabulator
celery
4.2.0
certifi2018.8.24 # via requests
cffi
1.11.5 # via cryptography
chardet3.0.4 # via requests
click
6.7 # via flask, flask-appbuilder, tableschema, tabulator
colorama0.3.9
contextlib2
0.5.5
cryptography1.9
defusedxml
0.5.0 # via python3-openid
docutils0.14 # via botocore
et-xmlfile
1.0.1 # via openpyxl
flask-appbuilder1.12.1
flask-babel
0.11.1 # via flask-appbuilder
flask-caching1.4.0
flask-compress
1.4.0
flask-login0.4.1 # via flask-appbuilder
flask-migrate
2.1.1
flask-openid1.2.5 # via flask-appbuilder
flask-sqlalchemy
2.4 # via flask-appbuilder, flask-migrate
flask-wtf0.14.2
flask
1.0.0
flower0.9.2
future
0.16.0
futures3.1.1 # via flower
geopy
1.11.0
gunicorn19.8.0
html5lib
1.0.1 # via bleach
humanize0.5.1
idna
2.6
ijson2.3 # via tabulator
isodate
0.6.0
itsdangerous0.24 # via flask
jdcal
1.4 # via openpyxl
jinja22.10 # via flask, flask-babel
jmespath
0.9.3 # via boto3, botocore
jsonlines1.2.0 # via tabulator
jsonschema
3.0.1 # via tableschema
kombu4.2.1 # via celery
linear-tsv
1.1.0 # via tabulator
mako1.0.7 # via alembic
markdown
3.0
markupsafe1.0 # via jinja2, mako
numpy
1.15.2 # via pandas
openpyxl2.4.11 # via tabulator
pandas
0.23.4
parsedatetime2.0.0
pathlib2
2.3.0
polyline1.3.2
pycparser
2.19 # via cffi
pydruid0.4.4
pyhive
0.5.1
python-dateutil2.6.1
python-editor
1.0.3 # via alembic
python-geohash0.8.5
python3-openid
3.1.0 # via flask-openid
pytz2018.5 # via babel, celery, flower, pandas
pyyaml
3.12
requests2.18.4
rfc3986
1.1.0 # via tableschema
s3transfer0.1.13 # via boto3
sasl
0.2.1 # via thrift-sasl
simplejson3.15.0
sqlalchemy-utils
0.32.21
sqlalchemy1.2.18
sqlparse
0.2.4
tableschema1.5.0
tabulator
1.15.0 # via tableschema
thrift-sasl0.3.0
thrift
0.11.0
tornado5.1.1 # via flower
unicodecsv
0.14.1
unidecode1.0.22
urllib3
1.22 # via requests
vine1.1.4 # via amqp
webencodings
0.5.1 # via html5lib
werkzeug0.14.1 # via flask
wtforms
2.2.1 # via flask-wtf
xlrd==1.1.0 # via tabulator

四.参考博客

https://fangyeqing.github.io/2017/03/04/superset%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83%E6%90%AD%E5%BB%BA/

https://www.bootschool.net/article/5d2e9fc2f60a310de45c8ed6/how-to-install-yarn-on-centos7-and-use-it

你可能感兴趣的:(linux环境下superset源码编译安装文档--非pip安装)