Hello There! I have made an app. The app worked on localhost but on streamlit cloud it doesn’t work.
Please tell me why.
Steps to reproduce
Code snippet:
# Download and save each file
for item in items:
file_id = item["id"]
file_name = item["name"]
# ファイルの内容をバイト列として変数に格納
file_content = service.files().get_media(fileId=file_id).execute()
if file_content is not None:
file_path = os.path.join('./temp', file_name)
with open(file_path, "wb") as f:
f.write(file_content)
error
FileNotFoundError: [Errno 2] No such file or directory: ‘./temp/営業企画通達no297_アウトドアスプレーならびにマスクスプレ-について取扱いのお願い.pdf’
The error is saying that there is no such file in that path
so your code is looking for pdf file in ./temp but there is no such file in cloud
either you add them manually or chech where the pdf files are being stored
Thank you for your reply!
I think this code(with open(file_path, “wb”) as f:) make PDFfile of file_path.
But it wasn’t made. On localhost it was made it but on streamlit cloud wasn’t made it.
If you know why please tell me.
Thank you for your cooperation.