合作研究python无法连接到gdrive

时间:2019-01-17 11:25:27

标签: connection google-colaboratory

我正在尝试在我的colab研究ipython中连接到gdrive。但是今天早上我编写这段代码时,

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

它向我抛出一个错误代码;

ValueError: Mountpoint must be in a directory that exists 

gdrive

我无法连接到gdrive,这可能是什么原因? 谢谢

2 个答案:

答案 0 :(得分:0)

实际解决方法不是添加force_remount=True,而是将arg中的尾随/放到drive.mount()中。

答案 1 :(得分:-1)

实际上我得到了答案。 İnstead

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

下面需要输入

from google.colab import drive
drive.mount('/content/drive', force_remount=True)

谢谢