webmaster-kazu.com

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

データ分析の際のグラフ作成が容易にできる「pyecharts」のインストール

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

データ分析の際のグラフ作成が容易にできる「pyecharts」のインストールについて解説しています。

「pyecharts(https://github.com/pyecharts/pyecharts)」は、グラフ作成が容易にできるPythonライブラリで、30種類以上のグラフを作成することができます。また、主要なNotebook環境であるJupyter NotebookとJupyterLabに対応し、Flask、Sanic、Djangoなど主要なWebフレームワークと統合も可能です。

■Python

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

■pyechartsをインストールする

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

pip install pyecharts

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

なお、今回は、pythonランチャーを使用しており、Python Version 3.8.5にインストールを行うために、バージョンの切り替えを行います。

py -3.8 -m pip install pyecharts

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

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

Collecting pyecharts

Downloading pyecharts-1.9.1-py3-none-any.whl (135 kB)

---------------------------------------- 135.6/135.6 kB 1.1 MB/s eta 0:00:00

Collecting simplejson

Downloading simplejson-3.17.6-cp38-cp38-win_amd64.whl (75 kB)

---------------------------------------- 75.9/75.9 kB 1.1 MB/s eta 0:00:00

Requirement already satisfied: jinja2 in c:\users\user_\appdata\roaming\python\python38\site-packages (from pyecharts) (3.1.2)

Collecting prettytable

Using cached prettytable-3.3.0-py3-none-any.whl (26 kB)

Requirement already satisfied: MarkupSafe>=2.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from jinja2->pyecharts) (2.1.1)

Collecting wcwidth

Using cached wcwidth-0.2.5-py2.py3-none-any.whl (30 kB)

Installing collected packages: wcwidth, simplejson, prettytable, pyecharts

Successfully installed prettytable-3.3.0 pyecharts-1.9.1 simplejson-3.17.6 wcwidth-0.2.5

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

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