Google Colab驱动器挂载(带下划线)不起作用 [英] Google Colab drive mount (with underscore) is not working

查看:28
本文介绍了Google Colab驱动器挂载(带下划线)不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

直到昨天(1月20日)我还可以连接到另一个Google驱动器帐户(使用drive._mount),但是当我今天尝试时,Google CoLab显示此错误:

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

    /usr/local/lib/python3.7/dist-packages/google/colab/drive.py in _mount(mountpoint, force_remount, timeout_ms, use_metadata_server, ephemeral)
    294       wrote_to_fifo = True
    295     elif case == 5 and not use_metadata_server:
--> 296       raise ValueError('mount failed: invalid oauth code')
    297     elif case == 6:
    298       # Terminate the DriveFS binary before killing bash.

ValueError: mount failed: invalid oauth code

奇怪的是,错误告诉我&Quot;无效的OAuth代码&Quot;,而不是让我连接到Google页面并复制代码!

我设置USE_METADATA_SERVER=True,但这次出现新的错误:

    from google.colab import drive
    drive._mount('/content/drive/', use_metadata_server=True)
ValueError                                Traceback (most recent call last)
<ipython-input-5-42a561ce7057> in <module>()
      1 from google.colab import drive
----> 2 drive._mount('/content/drive/', use_metadata_server=True)

/usr/local/lib/python3.7/dist-packages/google/colab/drive.py in _mount(mountpoint, force_remount, timeout_ms, use_metadata_server, ephemeral)
    285             ': timeout during initial read of root folder; for more info: '
    286             'https://research.google.com/colaboratory/faq.html#drive-timeout')
--> 287       raise ValueError('mount failed' + extra_reason)
    288     elif case == 2:
    289       # Not already authorized, so do the authorization dance.

ValueError: mount failed
我还使用了drive.mount,但显示了弹出窗口,并要求我输入另一个帐户凭据。当我输入它时,出现以下错误:

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

MessageError                              Traceback (most recent call last)
<ipython-input-1-91874b305a32> in <module>()
      1 from google.colab import drive
----> 2 drive.mount('/content/drive/')

3 frames
/usr/local/lib/python3.7/dist-packages/google/colab/_message.py in read_reply_from_input(message_id, timeout_sec)
    104         reply.get('colab_msg_id') == message_id):
    105       if 'error' in reply:
--> 106         raise MessageError(reply['error'])
    107       return reply.get('data', None)
    108 

MessageError: Error: credential propagation was unsuccessful

我认为这是新政策。是否有解决方案?

推荐答案

此功能已删除,您现在只能从笔记本的同一帐户挂载谷歌驱动器。 https://github.com/googlecolab/colabtools/issues/2562#issuecomment-1017869732

这篇关于Google Colab驱动器挂载(带下划线)不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆