Streamlit Deployment as an Executable File (.exe) For Windows MacOS And Android

No I haven’t But it should work 'cause both platforms deploy your app as an website and nativefier requires a website url not specifically an streamlit sharing url.

So in the end it doesn’t matter where to deploy just get the url and paste it in the nativefier url

1 Like

Sorry to reopen the subject. I am currently working on a Data Science project which necessit to store files (using seafile cloud solution). I would like to know if with those executables we can access to local file from our computer ?

Great job!!! I’m wondering is there any possibility to share executive file in offline environment?

1 Like

Same problem here for windows.

Hi @imClumsyPanda,

The instructions are a bit convoluted at the moment, but our approach was to use pyinstaller to creat streamlit executables:

Thanks a lot! And I’ll have a try!

Simon Biggs via Streamlit <streamlit@discoursemail.com>于2021年2月7日 周日上午5:20写道:

I did it and it worked perfectly :ok_hand:t3:

2 Likes

This you just did is so amazing. My respect for you.

1 Like

Hello for your solution to work is it required to have the model deployed on streamlit since I tried it with a private github repo the app had been built but when I opened it, it shows a blank white screen

wow… amazing its work even in local host

C:\Users\hp>nativefier --name one_2 http://localhost:8501 --platform windows

:star_struck: :star_struck: :star_struck:

3 Likes

Hi there, how did you get it to work with localhost? Did you have to put any code in the main app to get it working? I just get a white screen like the user above mentioned.

Hi, I realized that my app only work in my machine, and the ‘app.exe’ need the exact ‘file.py’ that you use to run your streamlit app, so if you delete or move the file.py to other folder, or computer, the app.exe will not work…

As reported above, the best way is to deploy and then create the executable.

1 Like

Thanks for the prompt reply!

Yeah I tried it exactly as you mentioned locally, seems it requires the py file. Will try to deploy then create the exe :slight_smile:

Thanks again!

Hi @Edmilson_Philimone, @beep92,

The streamlit application acts as a frontend and backend, where the backend contains all the logic you put into the app. The Nativefier application grabs the generated frontend code (html, js, css) and puts it into Electron app. So it still depends on the backend to be running for all input and output to be processed. So the streamlit app will indeed need to be deployed somewhere in order for the nativefier application to work correctly.

My explanation might be a bit off here and there, but this is my understanding of it :slight_smile:.

4 Likes

Hello @maarten-betman,

You’re spot on; I researched the Nativefier application a bit right after, and it just extracts the frontend as an exe as you mentioned, not really extracting the full application - so I can’t use it anyways (not really a solution for offline use).

I’ll have to continue my research on making it fully usable offline as a deployed application :slight_smile: .

Appreciate your response!

3 Likes

Hi @beep92,

Good to know :slight_smile:

I dockerized a couple of streamlit application for offline usage (I work quite remote sometimes). Pulling the image will of course require internet, but there after should be no problem. If you don’t want to put the image on dockerhub there’s some pretty affordable private repo options or you can package the image as a tarball (I believe). For the less tech-savy users you can make a small batch script they can run once to get the container up for the first time, there after they can use the Docker desktop GUI to restart containers which is quite user friendly.

You’re awesome, thank you @maarten-betman.

I will give this a try tonight, that sounds interesting - it could work for me. I just saw that docker hub costs a small monthly fee to host private repos. I will test with some dummy code and if it works, it might be the best option for now.
My users are not tech-savy at all, so the batch file is probably the best way to go to launch the app. I’ll test this out as I’m not too familiar with docker yet. I’ll report back my results :slight_smile:

1 Like

Thanks its worked only with the final command i used
nativefier URL, however takes time to connect to streamlit server and every operation take more time