v4.3 is the last version which works with Streamlit on Windows
macOS seems to be working but something triggers errors in Windows on versions after v4.3.
There is a Github action, you can check the output for v4.5.1 vs v4.3:
https://github.com/aljosa/pyinstaller-streamlit-issues/actions/runs/1150131459
Please note that I use timeout to shutdown the Streamlit server and that's why both versions exit w/ error.
This is the error w/ versions after v4.3:
Exception in thread ScriptRunner.scriptThread:
Traceback (most recent call last):
File "linecache.py", line 95, in updatecache
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'D:\\a\\pyinstaller-streamlit-issues\\pyinstaller-streamlit-issues\\dist\\main\\streamlit\\elements\\empty.pyc'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "streamlit\script_runner.py", line 350, in _run_script
File "D:\a\pyinstaller-streamlit-issues\pyinstaller-streamlit-issues\hello.py", line 4, in <module>
ui.init()
File "D:\a\pyinstaller-streamlit-issues\pyinstaller-streamlit-issues\ui.py", line 7, in init
TEXT = st.empty()
File "streamlit\elements\empty.py", line 66, in empty
File "streamlit\delta_generator.py", line 372, in _enqueue
File "streamlit\__init__.py", line 501, in _maybe_print_use_warning
File "streamlit\env_util.py", line 42, in is_repl
File "inspect.py", line 1526, in stack
File "inspect.py", line 1503, in getouterframes
File "inspect.py", line 1477, in getframeinfo
File "inspect.py", line 794, in findsource
File "linecache.py", line 47, in getlines
File "linecache.py", line 103, in updatecache
File "PyInstaller\loader\pyimod03_importers.py", line 343, in get_source
File "encodings\cp1252.py", line 23, in decode
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 1438: character maps to <undefined>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "linecache.py", line 95, in updatecache
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'streamlit\\elements\\empty.py'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "threading.py", line 932, in _bootstrap_inner
File "threading.py", line 870, in run
File "streamlit\script_runner.py", line 172, in _process_request_queue
File "streamlit\script_runner.py", line 359, in _run_script
File "streamlit\error_util.py", line 46, in handle_uncaught_app_exception
File "traceback.py", line 167, in format_exc
File "traceback.py", line 120, in format_exception
File "traceback.py", line 508, in __init__
File "traceback.py", line 366, in extract
File "traceback.py", line 288, in line
File "linecache.py", line 16, in getline
File "linecache.py", line 47, in getlines
File "linecache.py", line 103, in updatecache
File "PyInstaller\loader\pyimod03_importers.py", line 343, in get_source
File "encodings\cp1252.py", line 23, in decode
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 1438: character maps to <undefined>