I thought maybe it was an issue because it is the exe file of a C file so I changed it to just a regular python file but even then I am getting the same error. Confused on what to do next. Any help would be appreciated. Thank you!
It seems like the original error was probably a result of trying to run a Windows executable on Streamlit Community Cloud, which uses a Linux environment.
You mentioned that you saw the same error when you used a Python file – was it the exact same error? And was the path to the file definitely correct?
One thing to consider is that the path will be different when you deploy your app on Streamlit Community Cloud vs. when you’re running your app locally.
You can write the current path via the following: st.write(os.getcwd())
The path will start with /mount/src/ when your app is deployed on Community Cloud.
and same thing when I do it with an absolute path: PermissionError: [Errno 13] Permission denied: '/mount/src/fireoccurrenceprediction/lightning/weather/cf-build-AB.py'
Another thing I noticed is that whenever the path is wrong I get a FileNotFoundError instead of a PermissionError so I do believe the path is correct.
We have a doc here on invoking a subprocess to run a Python script in your deployed app – I would try using the format suggested there to see if you still get a PermissionError
# streamlit_app.py
import streamlit as st
import subprocess
import sys
subprocess.run([f"{sys.executable}", "script.py"])
As I mentioned, you won’t be able to run cf-build-AB.exe via Community Cloud since it’s a Linux environment, but you should be able to run a Python file.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.