Change the default streamlit data (home) directory to use streamlit on an read-only embedded device

Hello World,
I’m using streamlit on an embedded linux device. There is only one linux user on this platform which is root. The home directory of root (/root) is located on a read-only storage device and there is a writable zone on the storage located in /data. When stream lit need to load a file it call the following function in file_util.py:

def get_streamlit_file_path(*filepath: str) → str:

"""Return the full path to a file in \~/.streamlit.

This doesn't guarantee that the file (or its directory) exists.

"""

home = Path.home()

if home is None:

    raise RuntimeError("No home directory.")



return str(home / CONFIG_FOLDER_NAME / Path(\*filepath))

So on my device streamlit will try to read/write files in /root/… which is read only in my case.
Will it be possible to change this function to check if there is an environment variable called STREAMLIT_HOME defined and if it is the case use its value as the base home directory or add an argument on the streamlit command line interface to define an optional alternative path for the home directory ?

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