Google Colab 驱动器安装(带下划线)无法正常工作

2024-02-16

直到昨天(1月20日)我还可以连接到另一个谷歌驱动器帐户(使用drive._mount),但是当我今天尝试这个时,谷歌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

奇怪的是,错误告诉我“无效的oauth代码”,但不让我连接到谷歌页面并复制代码!

我设置了 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 https://github.com/googlecolab/colabtools/issues/2562#issuecomment-1017869732

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Google Colab 驱动器安装(带下划线)无法正常工作 的相关文章

  • Python 3 os.urandom

    在哪里可以找到完整的教程或文档os urandom 我需要获得一个随机 int 来从 80 个字符的字符串中选择一个字符 如果你只需要一个随机整数 你可以使用random randint a b 来自随机模块 http docs pytho
  • 小组芹菜链任务

    shared task def process record x return 1 2 4 4 5 6 shared task def add pro id return pro id 10 shared task def dmap it
  • pytesseract 无法从图像中识别复杂的数学公式

    我在用pytesseractpython 中的模块 pytesseract从图像中识别文本 但它不适用于包含复杂数学公式 例如根 推导 积分数学问题或方程 的图像 代码2 py Import modules from PIL import
  • 如何使用 open with 语句打开文件

    我正在研究如何在 Python 中进行文件输入和输出 我编写了以下代码 将一个文件中的名称列表 每行一个 读取到另一个文件中 同时根据文件中的名称检查名称并将文本附加到文件中出现的位置 该代码有效 可以做得更好吗 我想用with open
  • 使用 Python37 运行时通过 Cloud Functions 生成缩略图

    我有一个由 Firebase 存储触发的 Google Cloud 函数 我想生成缩略图 虽然 Node js 文档有一个使用 ImageMagick 的示例 https cloud google com functions docs tu
  • Python 去掉字节 b' '

    import save string with open image jpg rb as f byte f read 1 while byte b byte f read 1 print byte 我得到的字节如下 b x00 我该如何摆脱
  • 用户警告:MovieWriter ffmpeg 不可用

    尝试在 google colab 上制作动画 收到此警告 用户警告 MovieWriter ffmpeg 不可用 warnings warn MovieWriter s 不可用 writer did pip 安装 ffmpeg 标准化但没有
  • 如何修复下载 spacy 模型的“无效语法”

    我尝试在 Jupyter 笔记本上下载 spacy 模型 但它打印出 无效语法 python m spacy download en core web sm 有什么解决方案可以帮助我成功下载模型吗 为了将来帮助某人 对我来说 这个问题是因为
  • pyqt4窗口调整大小事件

    我正在使用 python3 和 pyqt4 我希望每次运行时都会运行一些代码QMainWindow已调整大小 我想要这样的东西 self window resized connect self resize but resized不是内置函
  • 尽管遵循安装说明,Beaker 仍无法找到 Python 和 Julia 安装

    我最近安装了 Beaker Notebook 但无法启动 Python 我已经安装了 Python 它是使用 Anaconda 安装的 实际上推荐用于 Beaker 我已经编辑过beaker pref json指向我的安装 见下文 但它无法
  • python 3中pickle和_pickle有什么区别?

    我是 python 新手 想要实现fast对象序列化 我尝试使用json 但是太慢了 也尝试使用marshall模块 但是marshall序列化的对象的大小比pickle大6 7倍 所以我决定在我的项目中使用pickle 我读到了有关 cP
  • google-oauthlib-tool 不询问授权码,并且在 rpi-4B 上没有“--headless”选项

    我正在尝试嵌入谷歌助手SDK https developers google com assistant sdk在我的树莓派上通过以下方式本指南由 Google 提供 https developers google com assistan
  • 类似 zip() 的内置函数用 None 值从左侧填充不等长度

    是否有一个内置函数 其工作方式类似于 zip 但填充结果 以便结果列表的长度是最长输入的长度并填充列表从左边例如None 已经有一个answer https stackoverflow com a 1277311 2648551 using
  • 为什么python+sqlite3特别慢?

    我尝试使用 Python 2 7 4 sqlite3 和 Firefox SQLite Manager 0 8 0 处理对同一数据库的相同请求 在小型数据库 8000 条记录 上 Python 和 Firefox 都运行得很快并且给出了相同
  • msvcrt.getch() 每次都会检测到空格

    我正在编写一个简单的Python代码 它应该检测我的击键 但由于某种原因 在每次击键后检测空格 代码 import msvcrt print press escape to quit text while 1 char msvcrt get
  • Python 异常 - args 属性如何自动设置?

    假设我定义了以下异常 gt gt gt class MyError Exception def init self arg1 pass 然后我实例化该类以创建异常对象 gt gt gt e MyError abc gt gt gt e ar
  • 如何有效地计算另一列中每个元素的较大元素的数量?

    我有以下内容df name created utc 0 t1 cqug90j 1430438400 1 t1 cqug90k 1430438400 2 t1 cqug90z 1430438400 3 t1 cqug91c 143043840
  • Python中非常大的整数的math.pow是错误的[重复]

    这个问题在这里已经有答案了 我试图通过计算一个整数的非常大的幂来打印一个非常大的数字 尽管我的代码是正确的 但我没有观察到所需的输出 一般来说 Python解释器可以打印系统内存支持的非常大的整数 考虑到这个假设 下面是我正在运行的代码 a
  • 使用 rpy2 将 NULL 从 Python 转换为 R

    在 R 中经常NULL值用作默认值 使用 Python 和 RPy2 如何显式提供NULL争论 None不可兑换 NotImplementedError 字符串 NULL 只会被转换为字符串 并在执行过程中导致错误 采取以下示例 使用tsi
  • 为什么变量不在循环外更新?

    无法弄清楚为什么结果中的第一个键是 abc 而不是我期望的 c 我使用的是Python 3 6 4 数据结构很奇怪 因为我删除了不相关的键和值 f replace ab r data abc 1 def 2 ghi 3 jkf 4 lmn

随机推荐