I am trying to deploy a streamlit app on Google Cloud App Engine. Basically, the application requires to access some files which I have stored in a bucket. However, as I run the application a “File Not Found Error” is raised.
Accessing the file on my local machine is possible as shown in the image above however when I try to access the file stored on the bucket the error occurs as shown in the image.
Interestingly, if I copy the path to the file on the browser I can access it. Try here:
The sample code for the trial app is here:
import streamlit as st
def output(path): file = open(path,"r") lines= file.readlines() for line in lines: st.write(line) file.close() st.header("Using Local Directory") #Using the local directory output("requirements.txt") st.header("Using Google Cloud App Engine Platform") url = "https://storage.googleapis.com/fall-detector-307021.appspot.com" MODEL_DIR = os.path.join(url, "ProjectTwo") #Using Google Cloud App Engine - Fails output(os.path.join(MODEL_DIR,"requirements.txt")) st.write(MODEL_DIR)
Kindly help. (I am a beginner at deploying on the GCP App Engine)