0
0

Streamlitの環境でPython3勉強の記録

Last updated at Posted at 2024-09-11

StreamlitのPython3を勉強して自分用としてメモを残す

  1. 環境設定
    Python3 と Streamlit の環境を整える手順を説明する。
    今回のOSはWindows11とする。

    • Python3のインストール(未インストールの場合)
      ・リンク:https://www.python.org/downloads/
      ・もしくは、Windows11の既存アプリ:Mincrosoft storeでPython3ダウンロード

    • 環境変数を設定する。
      ・リンクからダウンロードした場合は、環境変数に設定する必要がある。
      ・Mincrosoft storeでダウンロードした場合は省く

    • コマンドプロンプトを起動しPython3のバージョンを確認

      python -V
      //Python 3.1x.xが出れば環境設定完了
      
    • 必要なパッケージのインストール
      以下のコマンドを実行する。

       pip install streamlit
      

      すると、streamlitのインストールが実行される。

  2. Streamlit helloの実行確認
    Streamlitが正しくインストールされたか確認するために、streamlit helloコマンドを実行し、初期デモアプリが動くか確認します。コマンドラインに以下を入力します:

    streamlit hello
    

ブラウザが開き、以下のような画面が出れば成功。
image.png

※もし、コマンドプロンプトでエラーメッセージが出れば、環境設定がしっかりと反映されていない可能性が高いので、コマンドプロンプトの再起動か、パソコンの再起動を試すこと。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0