After Cloud Run incorporated Cloud Function, I can no longer read Excel from the Bucket.
I am trying to read an Excel file from a Bucket.
The error is that the openpyxl library is not installed even though it is in the req.txf
Error:
Missing optional dependency 'openpyxl'
I believe that after Cloud Function was absorbed by Cloud Run, this error started.
Google's base image for creating Cloud Function has changed.
Hi @SrKart,
Welcome to Google Cloud Community!
I can see you having a problem with openpyxl not being present while reading an Excel file from a Google Cloud Storage bucket after moving from Cloud Functions to Cloud Run. This appears to be related to the base images used in the deployment environment and its recent modifications.
You may fix this by taking these steps:
The dependencies are not always bundled as in previous Cloud Functions superlite runner, they have to be defined within the new requirements.txt parameters so that those dependencies can be added in the build.
For more information regarding deploying functions in Cloud Run you may take a look at the official Google documentation: Building and Deploying Cloud Run Functions and Cloud Functions Release Notes.
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.
Hey Greb, I have added openpyxl on my requirements.txt but I am still getting the error:
requirements.txt:
openpyxl==3.1.2
main.py: