GCP AI Platform cannot read .SAV file stored in Google Cloud Storage (Python)

magnawhale

I have an AI Platform VM instance set up with a Python3 notebook. I also have a Google Cloud Storage bucket that contains numerous .CSV and .SAV files. I have no difficulties using standard python packages likes Pandas to read in data from the CSV files, but my notebook appears unable to locate my .SAV files in my storage bucket.

Does anyone know what is going on here and/or how I can resolve this issue?

import numpy as np
import pandas as pd
import pyreadstat

df = pd.read_spss("gs://<STORAGE_BUCKET>/datafile.sav")

---------------------------------------------------------------------------
PyreadstatError                           Traceback (most recent call last)
<ipython-input-10-30836249273f> in <module>
----> 1 df = pd.read_spss("gs://<STORAGE_BUCKET>/datafile.sav")

/opt/conda/lib/python3.7/site-packages/pandas/io/spss.py in read_spss(path, usecols, convert_categoricals)
     41 
     42     df, _ = pyreadstat.read_sav(
---> 43         path, usecols=usecols, apply_value_formats=convert_categoricals
     44     )
     45     return df

pyreadstat/pyreadstat.pyx in pyreadstat.pyreadstat.read_sav()

pyreadstat/_readstat_parser.pyx in pyreadstat._readstat_parser.run_conversion()

PyreadstatError: File gs://<STORAGE_BUCKET>/datafile.sav does not exist!
Dustin Ingram

The read_spss function can only read from a local file path:

path: pathstr or Path - File path.

Compare that with the read_csv function:

filepath_or_bufferstr: str, path object or file-like object - Any valid string path is acceptable. The string could be a URL. Valid URL schemes include http, ftp, s3, gs, and file. For file URLs, a host is expected.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to access Google Cloud Storage Bucket from AI Platform job

From Java

GCS - Read a text file from Google Cloud Storage directly into python

From Dev

Unknown buckets stored in my Google Cloud Platform storage

From Dev

Cannot upload large file to Google Cloud Storage

From Dev

Error Python API GCP Data Catalog - Google Cloud Platform

From Dev

How do you schedule GCP AI Platform notebooks via Google Cloud Composer?

From Python

How to download a file from Google Cloud Platform storage

From Dev

Are Google Sheets Stored in a GCP Storage Bucket Somewhere?

From Dev

Error Unziping a file - Jupyter Notebook - Python 2.x -3.x - AI Notebook -Google Cloud Platform

From Dev

How to read a Google Cloud Storage file from Google App Engine

From Dev

GCP: Full backup of the database in the google cloud platform

From Dev

Google Cloud Platform (GCP) Ingress unhealthy backend

From Dev

Propagating Error messages in Google Cloud Platform (GCP)

From Dev

GCP: Duplicate an existing project in Google Cloud Platform

From Dev

How to mount Cloud Filestore in GCP AI platform Jupyter notebook?

From Dev

How to Read .json file in python code from google cloud storage bucket

From Dev

How to read json file in cloud storage using cloud functions - python

From Dev

GCP AI platform training cannot use full GPU quota

From Dev

Google cloud AI platform error in executing job

From Dev

Google Cloud Platform - How to upload image file into google cloud storage bucket?

From Dev

Read JSON file content from google cloud storage bucket

From Dev

Read/download part of file from google cloud storage in java

From Dev

Read JSON file directly from google storage (using Cloud Functions)

From Java

How to upload a large file into GCP Cloud Storage?

From Dev

changes file name in gcp cloud storage

From Dev

Ideal way to read data in bucket stored batches of data for Keras ML training in Google Cloud Platform?

From Dev

Is it possible to use file system instead of actual Storage bucket in the cloud for development purposes (Google Cloud Platform)

From Dev

Error installing fbprophet on Google Cloud Platform AI Platform

From Dev

Read Shapefile from Google Cloud Storage using Dataflow + Beam + Python

Related Related

  1. 1

    How to access Google Cloud Storage Bucket from AI Platform job

  2. 2

    GCS - Read a text file from Google Cloud Storage directly into python

  3. 3

    Unknown buckets stored in my Google Cloud Platform storage

  4. 4

    Cannot upload large file to Google Cloud Storage

  5. 5

    Error Python API GCP Data Catalog - Google Cloud Platform

  6. 6

    How do you schedule GCP AI Platform notebooks via Google Cloud Composer?

  7. 7

    How to download a file from Google Cloud Platform storage

  8. 8

    Are Google Sheets Stored in a GCP Storage Bucket Somewhere?

  9. 9

    Error Unziping a file - Jupyter Notebook - Python 2.x -3.x - AI Notebook -Google Cloud Platform

  10. 10

    How to read a Google Cloud Storage file from Google App Engine

  11. 11

    GCP: Full backup of the database in the google cloud platform

  12. 12

    Google Cloud Platform (GCP) Ingress unhealthy backend

  13. 13

    Propagating Error messages in Google Cloud Platform (GCP)

  14. 14

    GCP: Duplicate an existing project in Google Cloud Platform

  15. 15

    How to mount Cloud Filestore in GCP AI platform Jupyter notebook?

  16. 16

    How to Read .json file in python code from google cloud storage bucket

  17. 17

    How to read json file in cloud storage using cloud functions - python

  18. 18

    GCP AI platform training cannot use full GPU quota

  19. 19

    Google cloud AI platform error in executing job

  20. 20

    Google Cloud Platform - How to upload image file into google cloud storage bucket?

  21. 21

    Read JSON file content from google cloud storage bucket

  22. 22

    Read/download part of file from google cloud storage in java

  23. 23

    Read JSON file directly from google storage (using Cloud Functions)

  24. 24

    How to upload a large file into GCP Cloud Storage?

  25. 25

    changes file name in gcp cloud storage

  26. 26

    Ideal way to read data in bucket stored batches of data for Keras ML training in Google Cloud Platform?

  27. 27

    Is it possible to use file system instead of actual Storage bucket in the cloud for development purposes (Google Cloud Platform)

  28. 28

    Error installing fbprophet on Google Cloud Platform AI Platform

  29. 29

    Read Shapefile from Google Cloud Storage using Dataflow + Beam + Python

HotTag

Archive