【问题标题】:Opening Streamlit using bat file results in File Not Fund Error使用 bat 文件打开 Streamlit 会导致 File Not Fund 错误
【发布时间】:2021-03-26 14:01:20
【问题描述】:
尝试使用 .bat 文件打开应用程序,以便其他用户不必使用终端打开应用程序。 bat文件内容如下
set root=C:\Users\***\Anaconda3
call %root%\Scripts\activate.bat
call conda activate dsatprediction
call streamlit run "C:\Users\***\PycharmProjects\dsatpred\app.py"
当文件运行时,它会导致
使用命令 streamlit run app.py 在终端上运行相同的应用程序。
感谢任何指导
【问题讨论】:
标签:
python
batch-file
streamlit
pycaret
【解决方案1】:
我不知道是什么导致了您看到的错误,但是我的批处理文件的处理方式不同,也许它可以帮助您。我得到了这段代码来运行我的文件:
call C:\[anaconda_path_goes_here]\envs\[env_name_goes_here]\Scripts\activate.bat
C:\[anaconda_path_goes_here]\envs\[env_name_goes_here]\Scripts\streamlit.exe run [path_to_streamlit_file]\[name_of_streamlit_file].py
我在我的环境中安装 conda 并直接在该环境中运行激活命令。也许它会有所作为。另一方面,我的流式应用程序不会从磁盘打开文件,因此它可能无法解决您的问题。