Superset installed in the windows

Foreword

Recent want to use what Superset, this is an open source project, you can generate graphs directly by writing sql, sometimes for some more time chart needs to be used on.
1

Superset is open source BI data analysis and visualization platform (formerly known as Caravel, Panoramix), the tool main features are self-analysis by the Airbnb (well-known online home short rental company), custom dashboards, analysis results visualization (export), user / role access control, also incorporates a SQL editor, can be a SQL editor query, the original visual analysis used to support the Druid, the development of the back to support a variety of relational databases and big data computing framework, such as: mysql, oracle, Postgres, Presto, sqlite, Redshift, Impala, SparkSQL, Greenplum, MSSQL.

http://superset.apache.org/tutorial.html

 

Installation and configuration of windows

superset official website have installed Tutorial: Portal
's official website shows that the current system is no official support for Windows, but in fact can be installed successfully, if it is installed under the windows, then use Python installation.
My environment is:  Windows 7 64-Wei
Here are some pre-preparation:

Installing Python

I installed the Python 3.6 version. Recommended version a little higher, a variety of coding problems Python 2.7 version exists on the windows.

1
2
F:\>python --version
Python 3.6.1

 

Installation virtualenv

virtualenv  is used to create a "quarantine" for the application of a Python runtime environment

1
2
3
4
5
6
F:\>pip install virtualenv
Collecting virtualenv
Downloading https://files.pythonhosted.org/packages/b6/30/96a02b2287098b23b875bc8c2f58071c35d2efe84f747b64d523721dc2b5/virtualenv-16.0.0-py2.py3-none-any.whl (1.9MB)
100% |████████████████████████████████| 1.9MB 265kB/s
Installing collected packages: virtualenv
Successfully installed virtualenv-16.0.0

Use virtualenv. First established in the D drive d: \ pycharm \ superset directory.
Create a virtual environment:  virtualenv env
activate, enable virtual environment (must use backslashes): env \ Scripts \ of an activate
1
2
3
4
5
6
7
8
9
10
D:\>md pycharm
D:\>cd pycharm
D:\pycharm>md superset
D:\pycharm>cd superset
D:\pycharm\superset>virtualenv env
Using base prefix 'c:\\program files (x86)\\python36-32'
New python executable in D:\pycharm\superset\env\Scripts\python.exe
Installing setuptools, pip, wheel...done.

D:\pycharm\superset>env\Scripts\activate

Of course, if you want to leave behind a virtual environment is this:
(env) D: \ PyCharm \ superset> env \ Scripts \ deactivate

 

Installation superset

1
2
3
4
5
6
7
8
9
10
11
12
13
(env) D:\pycharm\superset>pip install superset
Collecting superset
Downloading https://files.pythonhosted.org/packages/64/7e/186af3b4501c82794a9332530e8b310073779f555a3f20ee481a27b3bfaf/superset-0.26.3.tar.gz (50.6MB)
100% |████████████████████████████████| 50.6MB 45kB/s
Collecting bleach (from superset)
。。。
。。。
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

----------------------------------------
Command "d:\pycharm\superset\env\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\admin\\AppData\\Local\\Temp\\pip-install-_zyiqvlv\\python-geohash\\setup.py';f=getattr(tokenize, 'open', open)(__file__);
code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\admin\AppData\Local\Temp\pip-record-q7ds71hu\install-record.txt --single-version-externally-managed --compile --instal
l-headers d:\pycharm\superset\env\include\site\python3.6\python-geohash" failed with error code 1 in C:\Users\admin\AppData\Local\Temp\pip-install-_zyiqvlv\python-geohash\

Looked at is less visualstudio components, so I visualstudio 2015 version of reinstalling a bit.
When the vs2015 put something, I tried it again. Found or an error, this error is this:

1
2
error: [WinError . 3] system can not find the specified path. : 'C: \\ Program Files (x86) in the Microsoft SDKs \\ \\ lib \\ Windows \\ V8.1' 
Failed Building Wheel for Python-geohash

It looks less like a  Python-geohash  library. Then I go directly to this place equipment:  https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-geohash
here, there is one detail, it is to install the corresponding version of Python packages, such as my 3.6 , then this would correspond Download: python_geohash-0.8.5-CP36-cp36m-win32.whl if the downloaded version does not match, it would report this error: xxxx iS a Supported Wheel not ON the this Platform.
1

1
2
3
4
(env) D:\pycharm\superset>pip install C:\Users\admin\Downloads\python_geohash-0.8.5-cp36-cp36m-win32.whl
Processing c:\users\admin\downloads\python_geohash-0.8.5-cp36-cp36m-win32.whl
Installing collected packages: python-geohash
Successfully installed python-geohash-0.8.5

This installed, the next re-install it:
1
2
3
4
5
(env) D:\pycharm\superset>pip install superset
Collecting superset
。。。
Installing collected packages: pyyaml, superset
Successfully installed pyyaml-3.13 superset-0.26.3

This time the installation was successful.

 

Configuration

Then you configure

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Create an administrator account 
fabmanager the Create-ADMIN - APP superset

# initialize the database (at the lower windows, first enter the Python installation directory (or virtual directory virtualEnv's), lib \ site-packages \ superset \ under bin)
Python superset db upgrade

# load example (subsequent operations require site-packages superset under \ bin lib \ \)
Python superset load_examples

# initialize roles and permissions
Python superset the init

# start the service, port 8088, using the -p change the port number.
Python superset runserver -d

This time on the configuration finished, then open the browser to view the login page:  HTTP: // localhost: 8088
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
(env) D:\pycharm\superset\env\Lib\site-packages\superset\bin>Python superset runserver -d
?[34m-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
?[33mStarting Superset server in ?[31mDEBUG?[33m mode
?[34m-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
?[0m
2018-08-14 11:21:26,805:INFO:werkzeug: * Restarting with stat
?[34m-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
?[33mStarting Superset server in ?[31mDEBUG?[33m mode
?[34m-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
?[0m
2018-08-14 11:21:30,112:WARNING:werkzeug: * Debugger is active!
2018-08-14 11:21:30,116:INFO:werkzeug: * Debugger PIN: 243-075-165
2018-08-14 11:21:30,126:INFO:werkzeug: * Running on http://0.0.0.0:8088/ (Press CTRL+C to quit)
2018-08-14 11:21:30,958:INFO:werkzeug:127.0.0.1 - - [14/Aug/2018 11:21:30] "GET /superset/welcome HTTP/1.1" 200 -
2018-08-14 11:21:31,191:INFO:werkzeug:127.0.0.1 - - [14/Aug/2018 11:21:31] "GET /static/assets/images/favicon.png HTTP/1.1" 200 -
2018-08-14 11:21:31,241:INFO:werkzeug:127.0.0.1 - - [14/Aug/2018 11:21:31] "GET /superset/fave_dashboards/1/ HTTP/1.1" 200 -
2018-08-14 11:21:31,266:INFO:werkzeug:127.0.0.1 - - [14/Aug/2018 11:21:31] "GET /dashboardmodelviewasync/api/read?_oc_DashboardModelViewAsync=changed_on&_od_DashboardModelViewAsync=desc HTTP/1.1" 200 -
2018-08-14 11:21:31,296:INFO:werkzeug:127.0.0.1 - - [14/Aug/2018 11:21:31] "GET /superset/fave_slices/1/ HTTP/1.1" 200 -
2018-08-14 11:21:31,318:INFO:werkzeug:127.0.0.1 - - [14/Aug/2018 11:21:31] "GET /superset/recent_activity/1/?limit=50 HTTP/1.1" 200 -
2018-08-14 11:21:45,502:INFO:werkzeug:127.0.0.1 - - [14/Aug/2018 11:21:45] "GET /lang/zh HTTP/1.1" 302 -
2018-08-14 11:21:45,757:INFO:werkzeug:127.0.0.1 - - [14/Aug/2018 11:21:45] "GET /lang/zh HTTP/1.1" 302 -
2018-08-14 11:21:45,811:INFO:werkzeug:127.0.0.1 - - [14/Aug/2018 11:21:45] "GET / HTTP/1.1" 302 -
2018-08-14 11:21:45,818:INFO:werkzeug:127.0.0.1 - - [14/Aug/2018 11:21:45] "GET / HTTP/1.1" 302 -
2018-08-14 11:21:46,237:INFO:werkzeug:127.0.0.1 - - [14/Aug/2018 11:21:46] "GET /superset/welcome HTTP/1.1" 200 -
2018-08-14 11:21:46,600:INFO:werkzeug:127.0.0.1 - - [14/Aug/2018 11:21:46] "GET /superset/welcome HTTP/1.1" 200 -
2018-08-14 11:21:46,877:INFO:werkzeug:127.0.0.1 - - [14/Aug/2018 11:21:46] "GET /superset/welcome HTTP/1.1" 200 -

Login must enter a user name and password you just set. We can see there is a example demo just four loaded
1

 

Create a sql and generate charts

We scored on mysql, so before you install the mysqlclient:  PIP install the mysqlclient
Superset Supported databases:
1

Connect to a new database

  • Click: Data Source - Database (Sources-Databases)
  • Simply fill two: database (name), SQLAlchemy URI (If mysql, Chinese sure to set charset = utf8, or will be garbled)
  • Save (Save)

1
Test the connection, can not even express the

Add a new table

  • Click: data sources - Data Sheet (Sources-Tables)
  • Select the database - fill out the existence of this database table names
  • Save (Save)

1

Write sql

When the new table, click Save when you can go directly to the page to write a sql can view sql last saved to the dashboard, if it does not exist to build a final to the dashboard you can view the
1

1

1

1

In the charts you can see a chart that you have created if you want to create a new chart, then click on Add to the upper right corner. Superset provides many chart types:
1


1

to sum up

The windows environment is to take up, also tried it and found quite good, depending on how this thing at the back of better use.


Reference:
Superset installation and basic configuration tutorial in the windows of
Superset installation configuration in the windows

Guess you like

Origin www.cnblogs.com/wt869054461/p/11653563.html