Portable Streamlit with Python Portable

Hello,

My need is to put all the content (Python + App) on an usb key which can be used on demand on different computers. I tried using my Streamlit installation but of course when I put the Portable Python with Streamlit on an usb key, the streamlit.exe try to search like if it was on the previous installation.

Is it possible to use Streamlit with Python Portable on Windows without installation right ?

So for information, modifying the streamlit.exe changing the path of the python interpreter do the job. After you just have to go on the streamlit.exe directory with cmd and launch streamlit.exe run path_of_the_python_script.

I think an improvment could be to put this python path on a configuration file called by streamlit.exe. With that, Streamlit can become portable.

1 Like

Glad you were able to figure that out @cloud. This feels like one of those edge cases that if the community implemented it, we might consider merging a pull request, but it’s probably not something we’d work on ourselves. From my brief Google searching, it doesn’t look like Python Portable is supported anymore?

Best,
Randy

@randyzwitch I’m using https://sourceforge.net/projects/portable-python/ which seems to be supported, not http://portablepython.com/.

I resolved it patching streamlit.exe but it is not a long term solution. Maybe I’ll try to automate it with pefile library.
Technically, if streamlit readed the python path in a file, it could resolve it and permit to use the same streamlit.exe for differents python interpreters. We could also just imagine the same like currently but just a system to overwrite this value with a config file.

1 Like