Works locally but run into the permission error when deployed to streamlit cloud:
PermissionError: [Errno 13] Permission denied: ‘/home/adminuser/venv/lib/python3.9/site-packages/shap/cached_data’
Traceback:
File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
exec(code, module.__dict__)File "/mount/src/test.py", line 325, in <module>
X,y = load_shap_data()File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_utils.py", line 211, in wrapper
return cached_func(*args, **kwargs)File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_utils.py", line 240, in __call__
return self._get_or_create_cached_value(args, kwargs)File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_utils.py", line 266, in _get_or_create_cached_value
return self._handle_cache_miss(cache, value_key, func_args, func_kwargs)File "/home/adminuser/venv/lib/python3.9/site-packages/streamlit/runtime/caching/cache_utils.py", line 320, in _handle_cache_miss
computed_value = self._info.func(*func_args, **func_kwargs)File "/mount/src/test.py", line 307, in load_shap_data
return shap.datasets.adult()File "/home/adminuser/venv/lib/python3.9/site-packages/shap/datasets.py", line 169, in adult
cache(github_data_url + "adult.data"),File "/home/adminuser/venv/lib/python3.9/site-packages/shap/datasets.py", line 321, in cache
os.makedirs(data_dir, exist_ok=True)File "/usr/local/lib/python3.9/os.py", line 225, in makedirs
mkdir(name, mode)