File Permission Error creating temp directory

Hello! I am trying to use Ray Tune to tune hyperparameters for my model deployed on Streamlit Cloud, but I get this error:

Traceback (most recent call last):

  File "/home/appuser/venv/lib/python3.7/site-packages/streamlit/", line 430, in _run_script
    exec(code, module.__dict__)

  File "/app/fyp/", line 437, in <module>

  File "/home/appuser/venv/lib/python3.7/site-packages/ray/tune/", line 321, in run

  File "/home/appuser/venv/lib/python3.7/site-packages/ray/tune/", line 768, in _ray_auto_init


  File "/home/appuser/venv/lib/python3.7/site-packages/ray/_private/", line 105, in wrapper

    return func(*args, **kwargs)

  File "/home/appuser/venv/lib/python3.7/site-packages/ray/", line 937, in init


  File "/home/appuser/venv/lib/python3.7/site-packages/ray/", line 189, in __init__


  File "/home/appuser/venv/lib/python3.7/site-packages/ray/", line 386, in _init_temp

  File "/home/appuser/venv/lib/python3.7/site-packages/ray/_private/", line 835, in try_to_create_directory

    os.makedirs(directory_path, exist_ok=True)

  File "/usr/local/lib/python3.7/", line 223, in makedirs

    mkdir(name, mode)

PermissionError: [Errno 13] Permission denied: '/tmp/ray'

I’m quite new to this, so I’m not sure if its because I can’t create a temp folder on Streamlit itself or on Github. Thanks for helping! :slight_smile:

Hi @Kelly_Tan,

First, welcome to the Streamlit Community!!! :star: :tada: :partying_face: :partying_face:

Can you share your app link here and we can take a look?

Happy Streamlit-ing!