7
votes

since several days, i can not connect to google drive in google colaboratory.

here is the code, that before always worked:

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

I tried the following, after reading several blogs for a solution:

-> I only have two items in my first folder of google drive

-> My trash folder is empty

-> I reset all the sessions

-> I create new file for testing just the piece of code above.

-> I restarted my computer and my browser Chrome

-> I tried "drive.mount('/content/gdrive')" , drive.mount('/content/gdrive/'), drive.mount('/content/'), drive.mount('/content'), drive.mount('/content/gdrive/My Drive')

Any idea? Thanks a lot!

here is the error:

TIMEOUT                                   Traceback (most recent call last)
<ipython-input-2-9a9a89271754> in <module>()
      1 from google.colab import drive
----> 2 drive.mount('/content/gdrive/')

4 frames
/usr/local/lib/python3.6/dist-packages/pexpect/expect.py in timeout(self, err)
    142             exc = TIMEOUT(msg)
    143             exc.__cause__ = None    # in Python 3.x we can use "raise exc from None"
--> 144             raise exc
    145 
    146     def errored(self):

TIMEOUT: <pexpect.popen_spawn.PopenSpawn object at 0x7f5666fe0a90>
searcher: searcher_re:
    0: re.compile('google.colab.drive MOUNTED')
    1: re.compile('root@2cd8a6fe3c15-de18aaee18634b4c829aedf956090476: ')
    2: re.compile('(Go to this URL in a browser: https://.*)$')
    3: re.compile('Drive File Stream encountered a problem and has stopped')
    4: re.compile('drive EXITED')
<pexpect.popen_spawn.PopenSpawn object at 0x7f5666fe0a90>
searcher: searcher_re:
    0: re.compile('google.colab.drive MOUNTED')
    1: re.compile('root@2cd8a6fe3c15-de18aaee18634b4c829aedf956090476: ')
    2: re.compile('(Go to this URL in a browser: https://.*)$')
    3: re.compile('Drive File Stream encountered a problem and has stopped')
    4: re.compile('drive EXITED')
3
-> I also tried in Safari browserLeo
-> I also tried drive.mount('/content/drive/',force_remount=True)Leo
Copy/Paste manually as a temporary fix. The group is aware and on it. Hoping for a fix soon. Cheers!Santy Monty

3 Answers

4
votes

This is being tracked in https://github.com/googlecolab/colabtools/issues/1540.

Workaround is to copy the oauth code using a mouse-drag instead of using the "copy" button.

3
votes

It looks like someone suggested manually copy-pasting the authentication code generated instead of pressing the copy button and then pasting. This worked for me :)

1
votes

Hi i copied the authentication code on to notepad and then pasted it from there onto the colab. It worked.