pythongoogle-drive-apiruntimegoogle-colaboratory

Getting 'TBE_EPHEM_CREDS_ADDR' after attempting to connect to Google Drive from Google Colab running via Locan Runtime on Docker


Changed my runtime to local due to constantly running out of computing blocks in Google Colab subscription, and decided to use the Local Runtime with GPU usage. Loaded all the files that were mentioned in the step-by-step from Google via this command for the CMD:

docker run --gpus=all -p 127.0.0.1:9000:8080 us-docker.pkg.dev/colab-images/public/runtime

All the files load up fine and dandy, attempt to connect the colab to my local runtime proceeds with no issues, running code blocks like importing libraries complete with no hiccups.

When I attempt to connect to my GDrive by using:

drive.mount('/content/drive/')

I get this error:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-3-8f32b5d56127> in <cell line: 1>()
----> 1 drive.mount('/content/drive/')

2 frames
/usr/lib/python3.10/os.py in __getitem__(self, key)
    678         except KeyError:
    679             # raise KeyError with the original key value
--> 680             raise KeyError(key) from None
    681         return self.decodevalue(value)
    682 

KeyError: 'TBE_EPHEM_CREDS_ADDR'

For the begging attempted to load up some of dependecies and libraries that are mentioned when starting the Docker Container, but that didn't helped. Found the answer from other topic here, that mentioned the requirement of GDrive client installation to resolve similar problem, but that didn't helped either.


Solution

  • Apparantely Docker Container doesn't have any sensible access to the GDrive in any form, so it's easier just to drag and drop the files that you want to use in it directly into the folders via Google Colabs interface or Docker's files interface and then just open them up using pd.read_csv (if it's .csv file).