LoginSignup
0
0
個人開発エンジニア応援 - 個人開発の成果や知見を共有しよう!-

streamlit helloを実行しようとすると、zsh: command not found: streamlitとでてしまう件

Last updated at Posted at 2023-09-23

会社でpythonを使った開発を始めようということで、streamlitを勉強しようと思い、streamlitを起動しようとstreamlit helloしたら、

zsh: command not found: streamlit

の文字が、、。
パスが通ってないのか。。
調べてみると
pip install streamlit実行時にどこにインストールされたのかが、吐き出されるwarningに出力されているとのこと。

WARNING: The script pygmentize is installed in '/Users/ユーザー名/Library/Python/3.8/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The scripts f2py, f2py3 and f2py3.8 are installed in '/Users/ユーザー名/Library/Python/3.8/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script normalizer is installed in '/Users/ユーザー名/Library/Python/3.8/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script markdown-it is installed in '/Users/ユーザー名/Library/Python/3.8/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script jsonschema is installed in '/Users/ユーザー名/Library/Python/3.8/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script streamlit is installed in '/Users/ユーザー名/Library/Python/3.8/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

ということで私のPCでのStreamlitのパスの位置は、
/Users/ユーザー名/Library/Python/3.8/bin
ということらしい。(ユーザー名はPCごとに設定された値に合わせてください。)

ではそこのパスを設定しようということで、

export PATH=$PATH:/Users/ユーザー名/Library/Python/3.8/bin

ここはzshの場合export、bshの場合はechoとなります。
自分のPCの設定に合わせてみて下さい!(私のPCはzshで設定しています。よくここの部分で間違える、、😢)

ようやくここで

streamlit hello

と打つとstreamlitが起動します!
パスの設定は、初めたての時はよく分からなかったりするので、参考になればと思い書いてみました!

是非ご活用下さい!

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