laboratory.kazuuu.net

Men of Letters(メン・オブ・レターズ) - 論理的思考/業務改善/プログラミング

【Python】統計データの可視化「Seaborn」のインストール

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

【Python】統計データの可視化「Seaborn」のインストールについて解説しています。

「Seaborn(https://github.com/mwaskom/seaborn)」は、matplotlibに基づく視覚化ライブラリです。統計グラフィックを描画するための高レベルのインターフェイスを提供している。

■Python

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

■seabornをインストールする

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

pip install seaborn

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

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

py -3.9 -m pip install seaborn

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

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

Collecting seaborn

Downloading seaborn-0.12.2-py3-none-any.whl (293 kB)

|████████████████████████████████| 293 kB 1.3 MB/s

Collecting matplotlib!=3.6.1,>=3.1

Using cached matplotlib-3.7.2-cp39-cp39-win_amd64.whl (7.5 MB)

Requirement already satisfied: numpy!=1.24.0,>=1.17 in c:\users\user_\appdata\roaming\python\python39\site-packages (from seaborn) (1.25.2)

Collecting pandas>=0.25

Downloading pandas-2.1.0-cp39-cp39-win_amd64.whl (11.2 MB)

|████████████████████████████████| 11.2 MB 3.2 MB/s

Collecting kiwisolver>=1.0.1

Downloading kiwisolver-1.4.5-cp39-cp39-win_amd64.whl (56 kB)

|████████████████████████████████| 56 kB 1.9 MB/s

Collecting pillow>=6.2.0

Using cached Pillow-10.0.0-cp39-cp39-win_amd64.whl (2.5 MB)

Collecting contourpy>=1.0.1

Using cached contourpy-1.1.0-cp39-cp39-win_amd64.whl (429 kB)

Collecting cycler>=0.10

Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB)

Collecting pyparsing<3.1,>=2.3.1

Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)

Collecting packaging>=20.0

Using cached packaging-23.1-py3-none-any.whl (48 kB)

Requirement already satisfied: importlib-resources>=3.2.0 in c:\users\user_\appdata\roaming\python\python39\site-packages (from matplotlib!=3.6.1,>=3.1->seaborn) (6.0.1)

Collecting fonttools>=4.22.0

Downloading fonttools-4.42.1-cp39-cp39-win_amd64.whl (2.1 MB)

|████████████████████████████████| 2.1 MB 3.3 MB/s

Collecting python-dateutil>=2.7

Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)

Requirement already satisfied: zipp>=3.1.0 in c:\users\user_\appdata\roaming\python\python39\site-packages (from importlib-resources>=3.2.0->matplotlib!=3.6.1,>=3.1->seaborn) (3.16.2)

Collecting tzdata>=2022.1

Using cached tzdata-2023.3-py2.py3-none-any.whl (341 kB)

Collecting pytz>=2020.1

Downloading pytz-2023.3.post1-py2.py3-none-any.whl (502 kB)

|████████████████████████████████| 502 kB 3.3 MB/s

Collecting six>=1.5

Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)

Installing collected packages: six, tzdata, pytz, python-dateutil, pyparsing, pillow, packaging, kiwisolver, fonttools, cycler, contourpy, pandas, matplotlib, seaborn

WARNING: The scripts fonttools.exe, pyftmerge.exe, pyftsubset.exe and ttx.exe are installed in 'C:\Users\user_\AppData\Roaming\Python\Python39\Scripts' which is not on PATH.

Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

Successfully installed contourpy-1.1.0 cycler-0.11.0 fonttools-4.42.1 kiwisolver-1.4.5 matplotlib-3.7.2 packaging-23.1 pandas-2.1.0 pillow-10.0.0 pyparsing-3.0.9 python-dateutil-2.8.2 pytz-2023.3.post1 seaborn-0.12.2 six-1.16.0 tzdata-2023.3

WARNING: You are using pip version 21.2.4; however, version 23.2.1 is available.

You should consider upgrading via the 'C:\Program Files\Python39\python.exe -m pip install --upgrade pip' command.

Enterキーを押すと、インストールが開始され、上記のように「Successfully installed」と表示されます。これが表示されれば、seabornが正常にインストールされたことになりますが、「WARNING」と表示されました。「WARNING」はエラーではなく警告で、インストールは行われているので、今回は一旦無視しています。

なお、今回はseabornのバージョン0.12.2をインストール