PermissionError: [Errno 13] Permission denied: '/home/adminuser/venv/lib/python3.9/site-packages/streamlit/static/css'

Hello, I have tried to deploy my project using Streamlit: Link
However, it shows PermissionError:


And yes, I am using a style.css file which is under css directory. I have tried handling it with the following code segment:

STREAMLIT_STATIC_PATH = Path(st.__path__[0]) / 'static'
CSS_PATH = (STREAMLIT_STATIC_PATH / "css")
if not CSS_PATH.is_dir():
    CSS_PATH.mkdir()

css_file = CSS_PATH / "style.css"
if not css_file.exists():
    shutil.copy("css/style.css", css_file)
st.markdown(
    f"""
   <link rel="stylesheet" href="css/style.css" type="text/css"/>
    """,
    unsafe_allow_html=True
)

But my project works fine locally using Streamlit, as you can see here:


The Git repository for the project is here.
So, how do I solve this PermissionError issue so that my deployed project works accordingly? Any advice would be appreciated.

With Regards.

Hey @ImranIF,

How can I reproduce this error in the hosted app? It seems to be working when I test it.

Hi, Thanks for replying. I moved my css directly to the style tag instead and it is working now. I guess the problem can be marked as solved.

1 Like

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