Closed bmox closed 3 years ago
It comes from the fact that in the function, the path is defined for Python 3.6 and colab upgraded to 3.7.
Instead of using the library, try to use this function (the function from the library, but with the variable path
updated)
from urllib.request import urlretrieve
def download_folder(folder_id):
""" I copy this one from my old code, use drive API directly (not pydrive) """
# authenticate
from google.colab import auth
auth.authenticate_user()
# get folder_name
from googleapiclient.discovery import build
service = build('drive', 'v3')
folder_name = service.files().get(fileId=folder_id).execute()['name']
# install library
url = 'https://github.com/segnolin/google-drive-folder-downloader/raw/master/download.py'
path = '/usr/local/lib/python3.7/dist-packages/download.py'
urlretrieve(url, path)
# recursive download
import download
download.download_folder(service, folder_id, './', folder_name)
return folder_name
My code
error: