查阅网上或者官网,大致安装流程是->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使用上的有趣的事。
快要到元旦了,祝大家元旦快乐。