Downloading csv from Cloud Storage to local machine using python

Dear Members,

I am a bit new to the community, I am called Anthony Matovu from Uganda, just certified in GCP Machine Learning.

Now I am facing some challenge, I would like to download a csv file I have in cloud storage to a local machine using python, when I put in the authenticated URL in a browser, the file gets downloaded, but when I put the same URL in the python code, it downloads the html not the CSV file.

Please help me.

Anthony

(PII Removed by Staff)

thank you.

1 Like

Greetings @AnthonyMatovu !

Welcome to the Google Cloud Community!

Refer to this documentation: Downloading Objects from your buckets in Cloud Storage.

  1. You need to have the proper IAM permissions to download an object.
  2. Under downloading an object from a bucket, navigate to client libraries and select python.
  3. You can use the example as a reference when downloading an object.

If the above option doesn’t work, you can contact Google Cloud Support to further look into your case. Let me know if it helped, thanks!

4 Likes

Thank you Marramirez

1 Like

Hello, I have a problem with downloading csv files from the google cloud. I pulled data from BigQuery using SQL, converted to pandas dataframe, and saved as csv files. The original df was with (4285684, 61) shape. I broke down and saved into 3 csv files, (1540419, 61): 871.5 MB, (1432347, 61): 810.8 MB, (1312918, 61): 742.9 MB. When I download these file to my computer, I do not get all of the lines. How can I download all of the lines in each file? I used to be able to download without a problem.

Hello, I have problems with downloading csv files pulled from BigQuery. The data converted to pandas dataframe (df) and saved to csv files.

I have pulled a df with the (4285684, 61) shape and broke down and saved into 3 csv files, (1540419, 61): 871.5 MB, (1432347, 61): 810.8 MB, (1312918, 61): 742.9 MB. When I download these file to my computer, I do not get all of the lines. How can I download all of the lines in each file? I used to be able to download without a problem.