Google datalab : how to import pickle
Is it possible in Google Datalab to read pickle/joblib models from Google Storage using %%storage clause? This question relates to Is text the only content type for %%storage magic function in datalab Run the following code in an otherwise empty cell: %%storage read --object <path-to-gcs-bucket>/my_pickle_file.pkl --variable test_pickle_var Then run following code: from io import BytesIO pickle.load(BytesIO(test_pickle_var)) I used the code below to upload a pandas DataFrame to Google Cloud Storage as a pickled file and read it back: from datalab.context import Context import datalab.storage