webmaster-kazu.com

テクノロジー・データ分析・実践ログ・その他

リアクティブなWebアプリを構築するためのPythonフレームワーク「dash」のインストール

カテゴリ: Python【初歩から現場実務的なもの】

リアクティブなWebアプリを構築するためのPythonフレームワーク「dash」のインストールについて解説しています。

dash(https://plotly.com/dash/)は、Plotly.js,React,Flaskの上に構築され、データサイエンスWebアプリを構築するのに向いているPythonフレームワークです。

■Python

今回のPythonのバージョンは、「3.8.5」を使用しています。(Windows10)(pythonランチャーでの確認)

■dashをインストールする

dashをインストールを行いますが、今回はpipを経由してインストールを行うので、まずWindowsのコマンドプロンプトを起動します。

pip install dash

起動後、上記のコマンドを入力し、Enterキーを押します。

なお、今回は、pythonランチャーを使用しており、Python Version 3.8.5にインストールを行うために、pipを使う場合にはコマンドでの切り替えを行います。

py -3.8 -m pip install dash

切り替えるために、上記のコマンドを入力し、Enterキーを押します。

Defaulting to user installation because normal site-packages is not writeable

Collecting dash

Downloading dash-2.2.0-py3-none-any.whl (8.5 MB)

|████████████████████████████████| 8.5 MB 1.7 MB/s

Collecting flask-compress

Downloading Flask_Compress-1.11-py3-none-any.whl (7.9 kB)

Collecting dash-core-components==2.0.0

Downloading dash_core_components-2.0.0-py3-none-any.whl (3.8 kB)

Collecting dash-table==5.0.0

Downloading dash_table-5.0.0-py3-none-any.whl (3.9 kB)

Collecting dash-html-components==2.0.0

Downloading dash_html_components-2.0.0-py3-none-any.whl (4.1 kB)

Requirement already satisfied: Flask>=1.0.4 in c:\users\user_\appdata\roaming\python\python38\site-packages (from dash) (2.0.1)

Requirement already satisfied: plotly>=5.0.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from dash) (5.5.0)

Requirement already satisfied: itsdangerous>=2.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from Flask>=1.0.4->dash) (2.0.1)

Requirement already satisfied: Jinja2>=3.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from Flask>=1.0.4->dash) (3.0.1)

Requirement already satisfied: click>=7.1.2 in c:\users\user_\appdata\roaming\python\python38\site-packages (from Flask>=1.0.4->dash) (8.0.4)

Requirement already satisfied: Werkzeug>=2.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from Flask>=1.0.4->dash) (2.0.1)

Requirement already satisfied: tenacity>=6.2.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from plotly>=5.0.0->dash) (8.0.1)

Requirement already satisfied: six in c:\users\user_\appdata\roaming\python\python38\site-packages (from plotly>=5.0.0->dash) (1.15.0)

Collecting brotli

Downloading Brotli-1.0.9-cp38-cp38-win_amd64.whl (365 kB)

|████████████████████████████████| 365 kB 6.4 MB/s

Requirement already satisfied: colorama in c:\users\user_\appdata\roaming\python\python38\site-packages (from click>=7.1.2->Flask>=1.0.4->dash) (0.4.4)

Requirement already satisfied: MarkupSafe>=2.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from Jinja2>=3.0->Flask>=1.0.4->dash) (2.0.1)

Installing collected packages: brotli, flask-compress, dash-table, dash-html-components, dash-core-components, dash

Successfully installed brotli-1.0.9 dash-2.2.0 dash-core-components-2.0.0 dash-html-components-2.0.0 dash-table-5.0.0 flask-compress-1.11

Enterキーを押すと、インストールが開始され、上記のように「Successfully installed」と表示されます。これが表示されれば、dashが正常にインストールされたことになります。

なお、今回はdashのバージョン2.2.0をインストールしました。