Streamlit-App to .EXE with Pyinstaller: Modules are not installed


I am following this tutorial to convert my Streamlit-App to an Executable, so that I can share it with other people locally.
The tutorial works and when I click on the “run.exe” file in the “dist”-Folder, the Streamlit-App is opening.
However I always getting the error, that some packages are not installed - but before using Pyinstaller I made sure that every package in my conda environment is installed. If I run the app solely in my env, everthing works. If I use the “run.exe” that results from Pyinstaller, I am getting “ModuleNotFoundError” on almost every package I am using.

How can I prevent this / What steps do I need to add in the tutorial to install for example a requirements.txt file?

Hi @moxinator98

Have you seen this excellent tutorial video on this very topic by @andfanilo

At 3:24 you can see that app dependencies can be defined in the package.json file.

Hope this helps!

Thanks but already tried this tutorial without success. Maybe some versions in the video are not up-to-date. Always getting errors like ValueError: Can't find a pure Python 3 wheel for 'faiss-cpu'. when calling npm run dump streamlit_app -- -U -r requirements.txt

Also getting the error: Error: ENOENT: no such file or directory, open '/Users/mweissenba001/Documents/StreamlitExeVersuch/stlite_versuch/build/stlite-manifest.json' when running npm run serve

In building faiss-cpu, perhaps you can check the link mentioned below for a specific Python version that has wheels for it

More info on this in this GitHub issues ERROR: Could not build wheels for faiss-cpu, which is required to install pyproject.toml-based projects in FreeBSD · Issue #80 · kyamagu/faiss-wheels · GitHub

I am getting the same error for almost every package I am using.
Maybe a stupid question: if i am using python==3.11.5 or python==3.9.18, how can I check if the Python version has wheels for it? So on the faiss link you provided, which version would you choose?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.