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
これで無事立ち上げまで完了。先が長い。