在 Google Colab Enterprise 中安装驱动器

问题描述 投票:0回答:1
!sudo echo -ne '\n' | sudo add-apt-repository ppa:alessandro-strada/ppa >/dev/null 2>&1 # note: >/dev/null 2>&1 is used to supress printing
!sudo apt update >/dev/null 2>&1
!sudo apt install google-drive-ocamlfuse >/dev/null 2>&1
!google-drive-ocamlfuse
!sudo apt-get install w3m >/dev/null 2>&1 # to act as web browser
!xdg-settings set default-web-browser w3m.desktop >/dev/null 2>&1 # to set default browser
%cd /content
!mkdir gdrive
%cd gdrive
!mkdir "My Drive"
!google-drive-ocamlfuse "/content/gdrive/My Drive"

我收到以下错误。

You should specify a client id (-id) and a client secret (-secret)

有什么建议如何解决这个问题吗?

python google-cloud-platform google-drive-api gcp-ai-platform-notebook
1个回答
0
投票

来自 README.md

首先,您必须设置 OAuth 2.0

  1. 激活
    Google Drive API
  2. 创建 OAuth 客户端 ID。
  3. 选择
    Desktop
    作为
    Application type
  4. Name
    设置为您喜欢的任何值。

这样您将获得

Client ID
Client secret
,您可以使用它们 访问您的云端硬盘。要授权
google-drive-ocamlfuse
,请传递客户端 ID 以及命令行上的客户端密码,例如:

google-drive-ocamlfuse -id xxxxxxxxxx.apps.googleusercontent.com -secret XXX-YYY-ZZZ

https://github.com/astrada/google-drive-ocamlfuse?tab=readme-ov-file#usage

© www.soinside.com 2019 - 2024. All rights reserved.