[Original] Superset installation configuration in windows, superset installation Configuration

Source: Internet
Author: User
Tags windows x86 virtualenv

[Original] Superset installation configuration in windows, superset installation Configuration

Superset is an open-source BI data analysis and visualization platform (formerly Caravel and Panoramix) by Airbnb (a well-known online house short rent company ), the tool provides self-service analysis, custom dashboard, visualized analysis results (export), and user/role permission control. It also integrates an SQL editor to edit and query SQL statements, it was originally used to support visual analysis of Druid. later it was developed to support many relational databases and big data computing frameworks, such as mysql, oracle, S, Presto, sqlite, Redshift, Impala, sparkSQL, Greenplum, MSSQL.

 

Superset official website address:

Http://superset.apache.org/index.html

The official website does not currently provide official support for Windows systems, but it can be installed successfully.

The installation environment is windows 10 64-bit Enterprise Edition.

 

Installation steps:

1. Install Python. We recommend that you install Python 3.4 or later. Python 2.7 has various Encoding Problems on windows.

Https://www.python.org/downloads/release/python-350/

Download a Windows x86-64 executable installer. You can directly use the installation package of exe and add it to the environment variable during installation.

Check: Run python-V and pip-V under CMD respectively. If no command is found, add the python installation directory to the path environment variable.

2. Install virtualenv. (This step is optional. If you install it directly, skip to step 4. Because Superset requires many components to be installed, it is best to use virtualenv to separate a python environment .)

When developing a Python application, the system installs only one version of Python 3. All third-party packages will bepipInstall python on Python 3site-packagesDirectory.

If we want to develop multiple applications at the same time, all these applications share one Python, that is, Python 3 installed on the system. What if application A requires jinja 2.7 and application B requires jinja 2.6?

In this case, each application may have an "independent" Python runtime environment. Virtualenv is used to create an "isolated" Python runtime environment for an application.

Installation command:

pip install virtualenv

3. Use virtualenv.

Create the d: \ python \ myproject directory on drive d.

d:md pythoncd pythonmd myprojectcd myproject

Then activate

Cd d: \ python \ myprojectvirtualenv env // wait until Initialization is complete... // activation: env \ Scripts \ activate

For example, note that there is an env mark on the left side of the command line input, so that subsequent operations will take effect in env without affecting the overall pyhton environment.

4. Install VS2015.

Some libraries dependent on in Superset must be compiled using microsoft visual c ++ 2010.

Follow instructions to install Visual C ++ 2015 Build Tools: http://landinghub.visualstudio.com/visual-cpp-build-tools

5. Install sasl.

This is a big pitfall. I have directly installed superset but it has never been installed successfully. An error is reported (sasl. h cannot be found ).

Solution: via http://www.lfd.uci.edu /~ Gohlke/pythonlibs/# download the corresponding sasl version

For example, we installed python 3.5, the system is 64-bit, download the sasl-0.2.1-cp35-cp35m-win_amd64.whl.
  

pip install D:\Downloads\sasl-0.2.1-cp35-cp35m-win_amd64.whl 

6. Install superset after the prerequisites are completed.

  

pip install superset
# Create an administrator account fabmanager create-admin -- app superset
# Initialize the database (in windows, first go to the Python installation directory (or virtual directory of virtualEnv), and under libs \ site-packages \ superset \ bin) Python superset db upgrade
# Loading example (subsequent operations must be performed in libs \ site-packages \ superset \ bin) Python superset load_examples # initialize the role and permission Python superset init # Start the service, port 8088, use-p to change the port number. Python superset runserver-d

 

Then, open localhost: 8088 in the browser to view the logon page.

 

 

7. Superset Localization

(1) Go to the Superset installation directory and run the following command to create the corresponding directory (translations/zh/LC_MESSAGES ):

    

md  translationscd translationsmd zhcd zhmd LC_MESSAGES

 

(2) download the localized mo File
Official github:
Https://github.com/apache/incubator-superset/tree/master/superset/translations/zh/LC_MESSAGES
Download the messages.mo file and put it in the directory created above
You can also download the messages. po file, manually convert it to Chinese, and then compile the po file into a mo file. The compilation method is as follows:
    

msgfmt messages.po -o messages.mo

 

(3) modify the config. py file and restart Superset. The modification part is as follows:

  

# Setup default language BABEL_DEFAULT_LOCALE = 'zh' # Your application default translation path BABEL_DEFAULT_FOLDER = 'babel/translations' # The allowed translation for you app LANGUAGES = { #'en': {'flag': 'us', 'name': 'English'}, # 'fr': {'flag': 'fr', 'name': 'French'}, 'zh': {'flag': 'cn', 'name': 'Chinese'} }

 

(4) Close the browser and re-open it to see the effect of localization.

 

8. data source.

Superset uses sqllite by default. The following databases are supported:

Database Pypi package SQLAlchemy URI prefix
MySQL pip install mysqlclient mysql://
Postgres pip install psycopg2 postgresql+psycopg2://
Presto pip install pyhive presto://
Oracle pip install cx_Oracle oracle://
Sqlite   sqlite://
Redshift pip install sqlalchemy-redshift postgresql+psycopg2://
MSSQL pip install pymssql mssql://
Impala pip install impyla impala://
SparkSQL pip install pyhive jdbc+hive://
Greenplum pip install psycopg2 postgresql+psycopg2://
Athena pip install "PyAthenaJDBC>1.0.9" awsathena+jdbc://
Vertica pip install sqlalchemy-vertica-python vertica+vertica_python://
ClickHouse pip install sqlalchemy-clickhouse clickhouse://

After installing the database using pip, you can configure the relevant data source on the Web interface.

For the database connection string format, see:

Http://docs.sqlalchemy.org/en/rel_1_0/core/engines.html#database-urls

 

Now, I will paste an example of My SQL Server test. SuperKM testing knowledge classification data is used.

In addition, superset currently only supports single table display.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.