我正在尝试从https://drive.google.com/drive/folders/my_folder_name
挂载一个目录,以便在google colab笔记本中使用。
装载文件夹的说明显示了以/content/drive开头的目录的示例:
from google.colab import drive
drive.mount('/content/drive')
但是我的目录不是以/content/drive
开头的,我尝试过的以下内容都导致了ValueError: Mountpoint must be in a directory that exists
drive.mount("/content/drive/folders/my_folder_name")
drive.mount("content/drive/folders/my_folder_name")
drive.mount("drive/folders/my_folder_name")
drive.mount("https://drive.google.com/drive/folders/my_folder_name")
如何挂载不是以/content/drive
开头的谷歌驱动器位置
发布于 2020-03-25 09:39:38
在我的例子中,这就是有效的方法。我想这就是Katardin的建议,除了我必须首先将这些子文件夹(通过链接访问)添加到我的驱动器中:
my_folder_name
.drive.mount('/content/drive')
data_dir = 'drive/My Drive/my_folder_name'
os.listdir(data_dir) # shows the subfolders I had shared with me
https://stackoverflow.com/questions/60841425
复制相似问题