E: Unable to locate package google-drive-ocamlfuse
使用colab原来挂载云盘的代码时出现了如上的错误,百度找不到解决办法,原代码如下
!apt-get install -y -qq software-properties-common python-software-properties module-init-tools
!add-apt-repository -y ppa:alessandro-strada/ppa 2>&1 > /dev/null
!apt-get update -qq 2>&1 > /dev/null
!apt-get -y install -qq google-drive-ocamlfuse fuse
from google.colab import auth
auth.authenticate_user()
from oauth2client.client import GoogleCredentials
creds = GoogleCredentials.get_application_default()
import getpass
!google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret} < /dev/null 2>&1 | grep URL
vcode = getpass.getpass()
!echo {vcode} | google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret}
在github上找到了解决办法
E: Unable to locate package google-drive-ocamlfuse · Issue #492 · astrada/google-drive-ocamlfuse
Not able to install google-drive-ocamlfuse · Issue #276 · googlecolab/colabtools
现将修改后的代码附在下面
import os
from google.colab import drive
drive.mount('/gdrive')
os.symlink('/gdrive/My Drive', '/content/gdrive')
!ls -l /content/gdrive/