Mount Google Drive In Kaggle Notebook
In google colab, I easily mount my google drive with this: from google.colab import drive drive.mount('/content/gdrive') In kaggle's notebook, however, it gives this error: KeyErr
Solution 1:
In fact, the google-colab
library does not exist in the Kaggle Kernel. In this way, I use the following procedure to deal with this problem in Kaggle Kernel:
First, extract the ID of your desire file from google drive:
Next, install
gdown
PyPI module usingconda
:! conda install -y gdown
Finally, download the file using
gdown
and the intended ID:!gdown --id <put-the-ID>
For example:
!gdown --id 1-1wAx7b-USG0eQwIBVwVDUl3K1_1ReCt
Solution 2:
google-colab
is not maintained by Google, and Colab libraries like drive.mount
won't work outside of the Colab environment itself.
Solution 3:
As the stack trace suggests you have some keys missing.
- CLOUDSDK_CONFIG
You can get this key by logging into GCP and searching for creds
To use these secretively: place this key into Kaggle Secrets Add-ons.
Post a Comment for "Mount Google Drive In Kaggle Notebook"