I created an app (‘main.py’) utilizing the custom components (streamlit_image_coordinates) which works fine when I start the streamlit app normally in command prompt with:
streamlit run main.py
As I am required to package the app with pyinstaller, I have created a wrapper script ‘run_main.py’ with following scripts:
import sys
from streamlit.web import cli as stcli
if __name__ == '__main__':
sys.argv = ['streamlit', 'run', './main.py']
sys.exit(stcli.main())
Whenever I launch the app via the wrapper script ‘run_main.py’, the section that render the custom component (streamlit_image_coordinates) will show the error:
Your app is having trouble loading the streamlit_image_coordinates.streamlit_image_coordinates component.
If this is an installed component that works locally, the app may be having trouble accessing the component frontend assets due to network latency or proxy settings in your app deployment.
However, the custom component works fine when I launch the main script directly with:
streamlit run main.py
I suspect this is caused by the wrapper script but I have not been able to find any workaround. I needed the wrapper script as otherwise I cannot package the app with pyinstaller. Any advice pls?
Environments:
- running app locally
- streamlit v1.39.0
- streamlit-image-coordinates v0.1.9
- python v3.8