0
0

More than 1 year has passed since last update.

streamlit初期動作不良

Posted at
1 / 2

Python学習入門〜streamlitの導入〜

Pythonの学習入門としてUdemyなどを活用しながら独学することにした。
今日はその第一歩のエラーとその対処法まとめ。

streamlitの導入

エラー
streamlit hello
zsh: command not found: streamlit

1番苦手な環境構築でやはり躓いた。
調べてみるとフルパスで呼びたす必要があるようだ。

対処法
 /Users/《ユーザー名》/Library/Python/《Pythonのバージョン》/bin/streamlit hello 

その後、無事streamlitを立ち上げることができたが、
やはりその起動で同じようなエラーが出現。

streamlit立ち上げ

エラー
=== streamlit内記述(main.py) ===
import streamlit as st
st.title('Streamlit 入門1日目')

=== ターミナル実行文 ===
stream run main.py
Warning: to view this Streamlit app on a browser, run it with the following
  command:
    streamlit run /Users/《ユーザー名》/《フォルダ名》/main.py [ARGUMENTS]

親切にも警告文で正しい表記について記述されており、そちらを参考に入力。
しかし、今度はまた導入時と同じ、コマンドが見つからないエラー。

ということで、両方ともフルパスにて実行し、見事成功。

対処法
Users/《ユーザー名》/Library/Python/《Pythonのバージョン》/bin/streamlit run /Users/《ユーザー名》/《フォルダ名》/main.py

これで無事立ち上げまで完了。先が長い。

スクリーンショット 2023-08-28 13.57.15.png

0
0
1

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