Superset environment construction steps

1. Operating system dependencies

Superset's database connection information is stored in the metabase, so they use the cryptography cryptography library to encrypt the connection information , but this library has OS level dependencies. So we need to install the dependencies required by this cryptographic library:

For Debian and Ubuntu, the following command will ensure the required dependencies are installed:

?
1
sudo apt-get install build-essential libssl-dev libffi-dev python-dev python-pip libsasl2-dev libldap2-dev

For Fedora and RHEL derivatives, the following command will ensure the required dependencies are installed:

?
1
2
3
sudo yum upgrade python-setuptools
 
sudo yum install gcc libffi-devel python-devel python-pip python-wheel openssl-devel libsasl2-devel openldap-devel

OSX, system python is deprecated. brew's python also has pip:

?
1
2
3
brew install pkg-config libffi openssl python
 
env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography

Like me, there is python2.7 directly under linux and I have not installed python, but it is recommended to use python3 or above, you can download python3 or above for testing.

2. Install python

You can go to this to see the installation of python, and there will be basically no errors: https://www.runoob.com/python/python-install.html
If you have installed python before, and now you have installed a higher version of python, Need to switch to the version of pyhton we want to use, you can go to Baidu to find out how to switch.

3. Python virtualenv environment

pip is a tool for installing and managing Python packages. pip depends on the pip repository. The default is: https://pypi.python.org/, as long as it is there, it can be installed.

It is recommended to install superset in the virtualenv environment, python3 already comes with virtualenv, python2 you need to install it, use pip to install:

?
1
pip install virtualenv

After installing the virtualenv environment, you can use pip list to see some tools installed by pip. We can create a virtualenv environment named venv, and then switch to the venv environment:

?
1
2
3
virtualenv venv
 
. ./venv/bin/activate

Once you activate your virtualenv everything you do is limited to the virtualenv. To exit virtualenv just type deactivate.

The following is to update pip and setuptools to the latest

?
1
pip install --upgrade setuptools pip

4、在virtualenv环境下使用pip来安装superset

pip install superset直接安装的话会安装最新的版本,但是好像最新版0.17.1版本汉化有点问题,如果想安装指定版本:pip install superset==xxx。如果网络不好的话会安装的有点久,而且可能会直接报错,连接超时

?
1
pip install superset

这里写图片描述
如果目录下有了superset的目录,说明你一已经安装好了。创建用户,会让你输入用户名,姓氏,名字,邮箱,密码 fabmanager create-admin --app superset

?
1
2
初始化数据库
superset db upgrade
?
1
2
加载一些数据到sqlite数据库中进行展示
superset load_examples
?
1
2
初始化superset
superset init
?
1
2
启动superset服务,默认端口是8088,我们也可以去superset的配置文件去更改
superset runserver

到这一步,我们就可以去浏览器访问superset了,输入:https://localhost:8088,会出现一个登录页面,输入刚才注册的用户名跟密码就可以登录进去 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324519824&siteId=291194637