【Linux】superset的安装、以及报错的坑

0.升级虚拟环境的python在3.6以上,可以通过 python -V 来查看版本
1.安装升级插件:

sudo yum upgrade python-setuptools
sudo yum install gcc libffi-devel python-devel python-pip python-wheel openssl-devel libsasl2-devel openldap-devel

2.在virtualenv中安装Superset:

pip install virtualenv
virtualenv venv
source ./venv/bin/activate

3.更新下载工具:

pip install --upgrade setuptools pip

4.pip安装相关依赖包:

(venv) [root@159fortest ~]# ~/venv/bin/python ~/venv/bin/pip freeze
alembic==1.4.3
amqp==5.0.1
apispec==3.3.2
attrs==20.2.0
Babel==2.8.0
backoff==1.10.0
billiard==3.6.3.0
biopython==1.78
bleach==3.2.1
boto3==1.4.7
botocore==1.7.48
Brotli==1.0.9
cached-property==1.5.2
celery==5.0.1
certifi==2020.6.20
cffi==1.14.3
chardet==3.0.4
click==6.7
click-didyoumean==0.0.3
click-repl==0.1.6
colorama==0.3.9
contextlib2==0.6.0.post1
croniter==0.3.35
cryptography==3.2
decorator==4.4.2
defusedxml==0.6.0
dnspython==2.0.0
docutils==0.15.2
elasticsearch==7.9.1
elasticsearch-dbapi==0.1.3
email-validator==1.1.1
et-xmlfile==1.0.1
Flask==0.12.5
Flask-AppBuilder==3.1.0
Flask-Babel==1.0.0
Flask-Caching==1.9.0
Flask-Compress==1.7.0
Flask-Ext==0.1
Flask-JWT-Extended==3.18.1
Flask-Login==0.4.1
Flask-Migrate==2.5.3
Flask-OpenID==1.2.5
Flask-Script==2.0.5
Flask-SQLAlchemy==2.4.4
flask-talisman==0.7.0
Flask-WTF==0.14.2
flower==0.9.5
future==0.16.0
geographiclib==1.50
Geohash==1.0
geopy==2.0.0
gunicorn==20.0.4
humanize==3.1.0
idna==2.10
ijson==3.1.2.post0
importlib-metadata==2.0.0
infi.clickhouse-orm==2.1.0
iso8601==0.1.13
isodate==0.6.0
itsdangerous==1.1.0
jdcal==1.4.1
Jinja2==2.11.2
jmespath==0.10.0
jsonlines==1.2.0
jsonschema==3.2.0
kombu==5.0.2
linear-tsv==1.1.0
Mako==1.1.3
Markdown==3.3.3
MarkupSafe==1.1.1
marshmallow==3.8.0
marshmallow-enum==1.5.1
marshmallow-sqlalchemy==0.24.0
msgpack==1.0.0
mysqlclient==2.0.1
natsort==7.0.1
numpy==1.19.2
openpyxl==3.0.5
packaging==20.4
pandas==0.23.4
parsedatetime==2.6
pathlib2==2.3.5
polyline==1.4.0
presto==0.6.2
prison==0.1.3
prometheus-client==0.8.0
prompt-toolkit==3.0.8
py==1.9.0
pyarrow==2.0.0
pycparser==2.20
pydruid==0.6.1
PyHive==0.6.0
PyJWT==1.7.1
PyMySQL==0.10.1
pyparsing==2.4.7
pyrsistent==0.17.3
pytest-runner==5.2
python-crontab==2.5.1
python-dateutil==2.8.1
python-editor==1.0.4
python-geohash==0.8.5
python3-openid==3.2.0
pytz==2020.1
PyYAML==5.3.1
redis==3.5.3
requests==2.24.0
retry==0.9.2
rfc3986==1.4.0
s3transfer==0.1.13
sasl==0.2.1
scipy==1.5.3
selenium==3.141.0
simplejson==3.17.2
six==1.15.0
SQLAlchemy==1.2.18
sqlalchemy-clickhouse==0.1.5.post0
SQLAlchemy-Utils==0.36.8
sqlparse==0.4.1
superset==0.28.1
tableschema==1.20.0
tabulator==1.52.4
thrift==0.13.0
thrift-sasl==0.4.2
tornado==6.0.4
unicodecsv==0.14.1
Unidecode==1.1.1
urllib3==1.25.11
vine==5.0.0
wcwidth==0.2.5
webencodings==0.5.1
Werkzeug==0.16.1
WTForms==2.3.3
WTForms-JSON==0.3.3
xlrd==1.2.0
zipp==3.4.0

5.安装superset

pip install superset==0.28.1

6.创建管理员

flask fab create-admin
'''
Username [admin]: 
User first name [admin]: 
User last name [user]: 
Email [[email protected]]: 
Password: 
Repeat for confirmation: 
'''

7.superset初始化

sudo superset db upgrade
sudo superset load_examples
sudo superset init

8.启动

superset run

bug及注意事项汇总

  1. 安装superset,注意superset的版本要选择0.28.1,版本选择不对会在后边报 auth_type.get(_appbuilder.sm.auth_type, "No Auth method")的异常
  2. 上边的是最新的创建管理员用户的命令,老版本命令是 fabmanager create-admin --app superset,如果提示 fabmanager : command not found,需要安装 pip install flask_appbuilder 之后 fabmanager 命令才可以使用。
  3. 必要时,删除 fabmanager在用户主目录下.superset隐藏目录的sqlite3数据库
  4. superset的命令通过 superset --help 查看
  5. geohash 这里面要提一下 这个包,需要到cd superset/venv/lib/python3.6/site-packages 下 把文件夹名叫Geohash 改成geohash然后再将geohash文件夹下_init_.py文件中得 from geohash修改成 from .geohash
  6. 报错:TypeError: __init__() got an unexpected keyword argument 'serialized_options' 这是由于包版本和python版本不匹配导致的,导入哪个包报这个错,就升级那个包,运行语句如下:pip install -U 包名

你可能感兴趣的:(云服务器,阿里云,python)