查閱網上或者官網,大致安裝流程是->pip3 install streamlit ->streamlit hello 但是這個操作在Ubuntu 或者是intel芯片的mac上是有效的,當在Mac M1上安裝使用時就會出現問題,當執行完第一條命令->pip3 install streamlit之后,第二條命令 ->streamlit hello會報錯zsh: command not found streamlit. 通過參考其他模塊安裝流程找到了答案:
應該在執行完第二條命令之后繼續執行 ->vim ~/.zshrc
然后添加->pip3 install streamlit 安裝過程顯示的路徑。 我的是 WARNING: The script streamlit is installed in '/Users/(MYNAME)/Library/Python/3.8/bin' which is not on PATH.
因此你需要將這個路徑添加到.zshrc文件中。export PATH=/Users/(MYNAME)/Library/Python/3.8/bin:$PATH
最后記得執行一下->source ~/.zshrc
ok that‘s all.
后續我會再發一些steamlit使用上的有趣的事。
快要到元旦了,祝大家元旦快樂。