Mounting Google Drive in Google Colab



Hello Readers! I don’t know what to write but i wasted 2–4 days in finding & fixing my issue, So i thought why not write it as my first medium post :)

I was previously using Colab configured using the method described here :- https://medium.com/deep-learning-turkey/google-colab-free-gpu-tutorial-e113627b9f5d

Unfortunately since past few days my colab was not loading, I tried restarting the runtime ,still no hopes.First I felt its colab issue, their servers might be down due to traffic ,soon i found out from logs that the ppa repository mentioned in the tutorial is down ie. the line

!add-apt-repository -y ppa:alessandro-strada/ppa 2>&1 > /dev/null

is closed perhaps , which lead to “E: Unable to locate package google-drive-ocamlfuse

Google Co-laboratory becomes useless if we can’t mount google drive there. After harsh searching, I found few great methods which could be used as alternatives :) which are.

1.You can mount your Google Drive files by running the following code snippet:

from google.colab import drive
drive.mount('/content/drive')

2.Using PyDrive , its a Google Drive wrapper for python client

here is a tutorial on how to use PyDrive, Its quite lengthy I would recommend to use it only if (1) doesn’t work

Source: Deep Learning on Medium