0

I have a python code to move files from one bucket to another bucket. However, I can't able to deploy the code.

I am getting the following error:

This is my requirements.txt

google-cloud-storage
zipfile
datetime
os

And my main.py

from google.cloud import storage
import zipfile
import datetime
import os

The 'google-cloud-storage' package is already exists but still my deployment is failing. Can anyone help me to resolve this issue?

1
  • 1
    Remove zipfile, datetime and os from requirements.txt and try again. Do not specify built-in packages in the requirements.txt file. Commented Jun 26, 2023 at 7:05

1 Answer 1

2

You know, sometimes the package already exists and we receive this error, so try to see whether you can import it or not.

As John Henley suggested in the comment, you need not to specify the zipfile manually. Zipfile is in the python standard library. import zipfile in main.py should work fine. Also remove datetime and os from requirements.txt file as john suggested already in the comment.

Make sure you run the pip install -r requirements.txt command to install all the required packages.

Not the answer you're looking for? Browse other questions tagged or ask your own question.