Import data from google drive to Kaggle Kernel



I want to import a csv file from google drive . I tried using the link in add dataset tab but it is taking some thing else as "Open". Please see the image.

enter image description here


Posted 2019-06-01T00:26:32.460

Reputation: 41

Question was closed 2020-12-01T20:08:27.390



  1. Go to your Google Drive and right click the dataset you want to upload to Kaggle.

  2. Generate the shareable link and the code that comes after, it should be a long code (like 3tlxSE__5eL3q7Zb31M3CEKHlieGWZYgM)

  3. Insert the long code at the end of

  4. Copy that link. Should look something like

  5. When uploading a dataset to Kaggle, select to add a file from remote URL.

  6. Insert copied URL.

  7. Done!

Nicolas Essipova

Posted 2019-06-01T00:26:32.460

Reputation: 51

But still getting

– Monukumar – 2019-06-01T00:53:35.663

And there is no error code whatsoever from Kaggle? – Nicolas Essipova – 2019-06-01T08:54:06.243

Have you ever tried it yourself? It does not work at all! – Arman Malekzadeh – 2020-03-01T16:28:12.887


Use gdown to directly download your google drive file into your session every time. The download speed is pretty high so it wont take much time.


The file id can obtained by the method described in the previous answer.

Purusharth Verma

Posted 2019-06-01T00:26:32.460

Reputation: 31


Here's the solution that works every time and very efficiently.

A) Case of file

import torchvision  
torchvision.datasets.utils.download_file_from_google_drive(file_id, root, filename=None, md5=None)

This download a Google Drive file and place it in root.
- file_id (str): id of file to be downloaded
- root (str): Directory to place downloaded file in
- filename (str, optional): Name to save the file under. If None, use the id of the file.
- md5 (str, optional): MD5 checksum of the download. If None, do not check

B) Case of folder

1.launch google colab and log into your google drive account.
2. zip the folder :
%cd /content/drive/"My drive"/.../my_folder
! zip -r my_folder

So you can download this zip file with torchvision wherever you want (, and unzip it with :
! unzip -d my_folder


Posted 2019-06-01T00:26:32.460

Reputation: 31


This works for me, pip install gdown won't work in Kaggle so follow this:

!conda install -y gdown

======================= or ==================

!conda install -y gdown 
import gdown 
url = '' 
output = '', output)

Your google drive id can be found from shared link

Biplob Das

Posted 2019-06-01T00:26:32.460

Reputation: 121