Hi! This looks like a really amazing project @whitphx!
I just have a couple of questions as someone who’s completely new to electron + web development but is looking to make my streamlit app into a desktop app.
I’m slightly confused by the need for the entire streamlit app to be compiled into webassembly to work with electron. Is it just that it’s easier to port a frontend only web app to electron? From my understanding, electron apps can have ‘backend’ code too (I know this distinction doesn’t make sense for a desktop app). Is it just harder to get this to work with streamlit?
My issue is that my app has a number of fairly complex dependencies, and after some testing, I don’t think it’s going to be possible to get all the requirements to work with wasm.
That said, I do have another solution which seems to work great for my slightly unusual use case. I’ve written an app which is designed to run on the head node of a HPC (it does some database management and job scheduling). Since HPCs are always linux, I’ve packaged my app as a singularity container. This is an executable, which automatically runs the streamlit app, and runs its internal version of chromium in app mode when executed. Singularity containers share the host display, and users open the app through SSH X forwarding, so it works on basically any other machine.
I just want to know if this seems a silly solution to anyone, compared to using electron. I suppose the main thing is the issues here of portability away from linux and the overhead of a container don’t really apply for a HPC only app
Is it possible to share the streamlit desktop app with other users?
For Example - upon running all the steps mentioned in this forum, lets say i am able to create a dist folder under which there is an executable file that runs my streamlit app.
Now if I can share this folder with other users, is it going to run in the same way that used to work in my desktop?
During establishing build files with yarn dump streamlit.app - requirements, I get the following error:
ValueError: Can’t find a pure Python 3 wheel for: ‘pyarrow>=7.0’, ‘tornado<7,>=6.0.3’, ‘watchdog>=2.1.5; platform_system != “Darwin”’
Is there any way to solve all dependencies and prepare a non-problematic wheels?
I first created “stlite”, a Wasm ver. of Streamlit, for technical interests and some benefits such as serverless execution or data privacy. Then I created the desktop app bundler as one of its applications.
So, for the purpose of packaging desktop apps, there are other options and you can use them as you actually did. Especially when your app doesn’t work on Wasm, stlite can’t be the option.
I just want to know if this seems a silly solution to anyone, compared to using electron.
So my answer to this is no. stlite is not always the best solution.
Yes. @stlite/desktop just uses electron-builder to bundle the executables, so you can use its options to build.
To build packages for Mac, Windows, and Linux, you can use the following command.
@Hikmet I think your requirements.txt includes streamlit but it’s not allowed because the streamlit package is automatically installed by stlite specifying its special build.
The latest release of @stlite/desktop has been updated about this so that it ignores streamlit in requirements.txt.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.