I have main.py (a simple Streamlit GUI):
import streamlit as st
st.text("This program is running")
And wrapper.py in the same dir:
import subprocess
subprocess.run(["streamlit", "run", "main.py"])
When I run the command pyinstaller --onefile --clean -w --add-data "main.py;." wrapper.py, an executable is created (without errors), and I can run this executable as .\dist\wrapper.exe, but when I double click it (in Windows), I get the following error:
Traceback (most recent call last):
File "wrapper.py", line 9, in <module>
File "subprocess.py", line 548, in run
File "subprocess.py", line 1024, in __init__
File "subprocess.py", line 1493, in _execute_child
FileNotFoundError: [WinError 2] The system cannot find the file specified
I have checked quite a few similar questions, but couldn't find a solution for my specific case.