最速で簡単にWebアプリを構築できるライブラリ「streamlit」をインストールする

スポンサーリンク

Pythonの最速で簡単にWebアプリを構築できるライブラリ「streamlit」のインストールについて解説しています。

Streamlitは、オープンソースのWebアプリフレームワークで、パフォーマンスの高いアプリをわずか数時間で作成することができます。なお、Pythonで作られており、無料で利用することができます。

■Python

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

■Streamlitをインストールする

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

pip install streamlit

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

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

py -3.8 -m pip install streamlit

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

Defaulting to user installation because normal site-packages is not writeable
Collecting streamlit
Downloading streamlit-0.82.0-py2.py3-none-any.whl (8.2 MB)
|████████████████████████████████| 8.2 MB 3.3 MB/s
Collecting requests
Using cached requests-2.25.1-py2.py3-none-any.whl (61 kB)
Collecting astor
Downloading astor-0.8.1-py2.py3-none-any.whl (27 kB)
Collecting tzlocal
Downloading tzlocal-2.1-py2.py3-none-any.whl (16 kB)
Collecting blinker
Downloading blinker-1.4.tar.gz (111 kB)
|████████████████████████████████| 111 kB 6.4 MB/s
Collecting pyarrow; python_version < "3.9"
Downloading pyarrow-4.0.1-cp38-cp38-win_amd64.whl (13.3 MB)
|████████████████████████████████| 13.3 MB 2.2 MB/s
Collecting tornado>=5.0
Downloading tornado-6.1-cp38-cp38-win_amd64.whl (422 kB)
|████████████████████████████████| 422 kB 3.2 MB/s
Collecting validators
Downloading validators-0.18.2-py3-none-any.whl (19 kB)
Collecting packaging
Downloading packaging-20.9-py2.py3-none-any.whl (40 kB)
|████████████████████████████████| 40 kB 2.7 MB/s
Requirement already satisfied: numpy in c:\users\user_\appdata\roaming\python\python38\site-packages (from streamlit) (1.20.3)
Collecting pydeck>=0.1.dev5
Downloading pydeck-0.6.2-py2.py3-none-any.whl (4.2 MB)
|████████████████████████████████| 4.2 MB 3.2 MB/s
Collecting toml
Downloading toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting watchdog; platform_system != "Darwin"
Downloading watchdog-2.1.2-py3-none-win_amd64.whl (74 kB)
|████████████████████████████████| 74 kB 1.3 MB/s
Requirement already satisfied: cachetools>=4.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from streamlit) (4.2.2)
Collecting altair>=3.2.0
Downloading altair-4.1.0-py3-none-any.whl (727 kB)
|████████████████████████████████| 727 kB 3.3 MB/s
Collecting pandas>=0.21.0
Downloading pandas-1.2.4-cp38-cp38-win_amd64.whl (9.3 MB)
|████████████████████████████████| 9.3 MB 3.3 MB/s
Collecting gitpython
Downloading GitPython-3.1.17-py3-none-any.whl (166 kB)
|████████████████████████████████| 166 kB 6.4 MB/s
Collecting base58
Downloading base58-2.1.0-py3-none-any.whl (5.6 kB)
Collecting click<8.0,>=7.0
Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
|████████████████████████████████| 82 kB 473 kB/s
Requirement already satisfied: pillow>=6.2.0 in c:\users\user_\appdata\roaming\python\python38\site-packages (from streamlit) (8.2.0)
Collecting protobuf!=3.11,>=3.6.0
Downloading protobuf-3.17.3-py2.py3-none-any.whl (173 kB)
|████████████████████████████████| 173 kB 3.3 MB/s
Collecting python-dateutil
Using cached python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
Collecting urllib3<1.27,>=1.21.1
Downloading urllib3-1.26.5-py2.py3-none-any.whl (138 kB)
|████████████████████████████████| 138 kB 3.3 MB/s
Collecting idna<3,>=2.5
Using cached idna-2.10-py2.py3-none-any.whl (58 kB)
Collecting certifi>=2017.4.17
Downloading certifi-2021.5.30-py2.py3-none-any.whl (145 kB)
|████████████████████████████████| 145 kB 3.3 MB/s
Collecting chardet<5,>=3.0.2
Using cached chardet-4.0.0-py2.py3-none-any.whl (178 kB)
Collecting pytz
Using cached pytz-2021.1-py2.py3-none-any.whl (510 kB)
Collecting decorator>=3.4.0
Downloading decorator-5.0.9-py3-none-any.whl (8.9 kB)
Collecting six>=1.4.0
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting pyparsing>=2.0.2
Downloading pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
|████████████████████████████████| 67 kB 1.7 MB/s
Collecting ipywidgets>=7.0.0
Downloading ipywidgets-7.6.3-py2.py3-none-any.whl (121 kB)
|████████████████████████████████| 121 kB 3.3 MB/s
Collecting traitlets>=4.3.2
Downloading traitlets-5.0.5-py3-none-any.whl (100 kB)
|████████████████████████████████| 100 kB 6.4 MB/s
Collecting jinja2>=2.10.1
Downloading Jinja2-3.0.1-py3-none-any.whl (133 kB)
|████████████████████████████████| 133 kB 6.8 MB/s
Collecting ipykernel>=5.1.2; python_version >= "3.4"
Downloading ipykernel-5.5.5-py3-none-any.whl (120 kB)
|████████████████████████████████| 120 kB 3.3 MB/s
Collecting toolz
Downloading toolz-0.11.1-py3-none-any.whl (55 kB)
|████████████████████████████████| 55 kB 1.2 MB/s
Collecting entrypoints
Downloading entrypoints-0.3-py2.py3-none-any.whl (11 kB)
Collecting jsonschema
Downloading jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
|████████████████████████████████| 56 kB 973 kB/s
Collecting gitdb<5,>=4.0.1
Downloading gitdb-4.0.7-py3-none-any.whl (63 kB)
|████████████████████████████████| 63 kB 644 kB/s
Collecting ipython>=4.0.0; python_version >= "3.3"
Downloading ipython-7.24.1-py3-none-any.whl (785 kB)
|████████████████████████████████| 785 kB 3.3 MB/s
Collecting widgetsnbextension~=3.5.0
Downloading widgetsnbextension-3.5.1-py2.py3-none-any.whl (2.2 MB)
|████████████████████████████████| 2.2 MB 3.2 MB/s
Collecting jupyterlab-widgets>=1.0.0; python_version >= "3.6"
Downloading jupyterlab_widgets-1.0.0-py3-none-any.whl (243 kB)
|████████████████████████████████| 243 kB 3.2 MB/s
Collecting nbformat>=4.2.0
Downloading nbformat-5.1.3-py3-none-any.whl (178 kB)
|████████████████████████████████| 178 kB 2.2 MB/s
Collecting ipython-genutils
Downloading ipython_genutils-0.2.0-py2.py3-none-any.whl (26 kB)
Collecting MarkupSafe>=2.0
Downloading MarkupSafe-2.0.1-cp38-cp38-win_amd64.whl (14 kB)
Collecting jupyter-client
Downloading jupyter_client-6.1.12-py3-none-any.whl (112 kB)
|████████████████████████████████| 112 kB 3.2 MB/s
Collecting pyrsistent>=0.14.0
Downloading pyrsistent-0.17.3.tar.gz (106 kB)
|████████████████████████████████| 106 kB 6.4 MB/s
Requirement already satisfied: setuptools in c:\program files\python38\lib\site-packages (from jsonschema->altair>=3.2.0->streamlit) (47.1.0)
Collecting attrs>=17.4.0
Downloading attrs-21.2.0-py2.py3-none-any.whl (53 kB)
|████████████████████████████████| 53 kB 797 kB/s
Collecting smmap<5,>=3.0.1
Downloading smmap-4.0.0-py2.py3-none-any.whl (24 kB)
Collecting jedi>=0.16
Downloading jedi-0.18.0-py2.py3-none-any.whl (1.4 MB)
|████████████████████████████████| 1.4 MB 3.3 MB/s
Collecting prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0
Downloading prompt_toolkit-3.0.18-py3-none-any.whl (367 kB)
|████████████████████████████████| 367 kB 6.4 MB/s
Collecting colorama; sys_platform == "win32"
Downloading colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting backcall
Downloading backcall-0.2.0-py2.py3-none-any.whl (11 kB)
Collecting matplotlib-inline
Downloading matplotlib_inline-0.1.2-py3-none-any.whl (8.2 kB)
Collecting pickleshare
Downloading pickleshare-0.7.5-py2.py3-none-any.whl (6.9 kB)
Collecting pygments
Downloading Pygments-2.9.0-py3-none-any.whl (1.0 MB)
|████████████████████████████████| 1.0 MB 3.3 MB/s
Collecting notebook>=4.4.1
Downloading notebook-6.4.0-py3-none-any.whl (9.5 MB)
|████████████████████████████████| 9.5 MB 3.3 MB/s
Collecting jupyter-core
Downloading jupyter_core-4.7.1-py3-none-any.whl (82 kB)
|████████████████████████████████| 82 kB 38 kB/s
Collecting pyzmq>=13
Downloading pyzmq-22.1.0-cp38-cp38-win_amd64.whl (1.0 MB)
|████████████████████████████████| 1.0 MB 100 kB/s
Collecting parso<0.9.0,>=0.8.0
Downloading parso-0.8.2-py2.py3-none-any.whl (94 kB)
|████████████████████████████████| 94 kB 97 kB/s
Collecting wcwidth
Downloading wcwidth-0.2.5-py2.py3-none-any.whl (30 kB)
Collecting terminado>=0.8.3
Downloading terminado-0.10.0-py3-none-any.whl (14 kB)
Collecting prometheus-client
Downloading prometheus_client-0.11.0-py2.py3-none-any.whl (56 kB)
|████████████████████████████████| 56 kB 569 kB/s
Collecting nbconvert
Downloading nbconvert-6.0.7-py3-none-any.whl (552 kB)
|████████████████████████████████| 552 kB 3.3 MB/s
Collecting argon2-cffi
Downloading argon2_cffi-20.1.0-cp38-cp38-win_amd64.whl (42 kB)
|████████████████████████████████| 42 kB 29 kB/s
Collecting Send2Trash>=1.5.0
Downloading Send2Trash-1.5.0-py3-none-any.whl (12 kB)
Collecting pywin32>=1.0; sys_platform == "win32"
Downloading pywin32-301-cp38-cp38-win_amd64.whl (9.3 MB)
|████████████████████████████████| 9.3 MB 78 kB/s
Collecting pywinpty>=1.1.0; os_name == "nt"
Downloading pywinpty-1.1.1-cp38-none-win_amd64.whl (1.4 MB)
|████████████████████████████████| 1.4 MB 6.4 MB/s
Collecting bleach
Downloading bleach-3.3.0-py2.py3-none-any.whl (283 kB)
|████████████████████████████████| 283 kB 3.2 MB/s
Collecting jupyterlab-pygments
Downloading jupyterlab_pygments-0.1.2-py2.py3-none-any.whl (4.6 kB)
Collecting nbclient<0.6.0,>=0.5.0
Downloading nbclient-0.5.3-py3-none-any.whl (82 kB)
|████████████████████████████████| 82 kB 146 kB/s
Collecting pandocfilters>=1.4.1
Downloading pandocfilters-1.4.3.tar.gz (16 kB)
Collecting defusedxml
Downloading defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Collecting testpath
Downloading testpath-0.5.0-py3-none-any.whl (84 kB)
|████████████████████████████████| 84 kB 475 kB/s
Collecting mistune<2,>=0.8.1
Downloading mistune-0.8.4-py2.py3-none-any.whl (16 kB)
Collecting cffi>=1.0.0
Downloading cffi-1.14.5-cp38-cp38-win_amd64.whl (179 kB)
|████████████████████████████████| 179 kB 3.3 MB/s
Collecting webencodings
Downloading webencodings-0.5.1-py2.py3-none-any.whl (11 kB)
Collecting async-generator
Downloading async_generator-1.10-py3-none-any.whl (18 kB)
Collecting nest-asyncio
Downloading nest_asyncio-1.5.1-py3-none-any.whl (5.0 kB)
Collecting pycparser
Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB)
|████████████████████████████████| 112 kB 3.3 MB/s
Using legacy setup.py install for blinker, since package 'wheel' is not installed.
Using legacy setup.py install for pyrsistent, since package 'wheel' is not installed.
Using legacy setup.py install for pandocfilters, since package 'wheel' is not installed.
Installing collected packages: urllib3, idna, certifi, chardet, requests, astor, pytz, tzlocal, blinker, pyarrow, tornado, decorator, six, validators, pyparsing, packaging, ipython-genutils, traitlets, parso, jedi, wcwidth, prompt-toolkit, colorama, backcall, matplotlib-inline, pickleshare, pygments, ipython, pyrsistent, attrs, jsonschema, pywin32, jupyter-core, nbformat, MarkupSafe, jinja2, pywinpty, terminado, prometheus-client, python-dateutil, pyzmq, jupyter-client, ipykernel, entrypoints, webencodings, bleach, jupyterlab-pygments, async-generator, nest-asyncio, nbclient, pandocfilters, defusedxml, testpath, mistune, nbconvert, pycparser, cffi, argon2-cffi, Send2Trash, notebook, widgetsnbextension, jupyterlab-widgets, ipywidgets, pydeck, toml, watchdog, toolz, pandas, altair, smmap, gitdb, gitpython, base58, click, protobuf, streamlit
Successfully installed MarkupSafe-2.0.1 Send2Trash-1.5.0 altair-4.1.0 argon2-cffi-20.1.0 astor-0.8.1 async-generator-1.10 attrs-21.2.0 backcall-0.2.0 base58-2.1.0 bleach-3.3.0 blinker-1.4 certifi-2021.5.30 cffi-1.14.5 chardet-4.0.0 click-7.1.2 colorama-0.4.4 decorator-5.0.9 defusedxml-0.7.1 entrypoints-0.3 gitdb-4.0.7 gitpython-3.1.17 idna-2.10 ipykernel-5.5.5 ipython-7.24.1 ipython-genutils-0.2.0 ipywidgets-7.6.3 jedi-0.18.0 jinja2-3.0.1 jsonschema-3.2.0 jupyter-client-6.1.12 jupyter-core-4.7.1 jupyterlab-pygments-0.1.2 jupyterlab-widgets-1.0.0 matplotlib-inline-0.1.2 mistune-0.8.4 nbclient-0.5.3 nbconvert-6.0.7 nbformat-5.1.3 nest-asyncio-1.5.1 notebook-6.4.0 packaging-20.9 pandas-1.2.4 pandocfilters-1.4.3 parso-0.8.2 pickleshare-0.7.5 prometheus-client-0.11.0 prompt-toolkit-3.0.18 protobuf-3.17.3 pyarrow-4.0.1 pycparser-2.20 pydeck-0.6.2 pygments-2.9.0 pyparsing-2.4.7 pyrsistent-0.17.3 python-dateutil-2.8.1 pytz-2021.1 pywin32-301 pywinpty-1.1.1 pyzmq-22.1.0 requests-2.25.1 six-1.16.0 smmap-4.0.0 streamlit-0.82.0 terminado-0.10.0 testpath-0.5.0 toml-0.10.2 toolz-0.11.1 tornado-6.1 traitlets-5.0.5 tzlocal-2.1 urllib3-1.26.5 validators-0.18.2 watchdog-2.1.2 wcwidth-0.2.5 webencodings-0.5.1 widgetsnbextension-3.5.1

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

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

※streamlitをインストールするにあたり、複数のライブラリが必要となりますので、インターネット環境などによっては、インストールに多少時間がかかる恐れがあります。

コメント

タイトルとURLをコピーしました