我试图从驱动器中加载文件夹,但是在加载时出现错误
ValueError Traceback (most recent call last)
<ipython-input-3-a977da366961> in <module>()
1 from google.colab import drive
----> 2 drive.mount('content/gdrive/My Drive/kaggle')
/usr/local/lib/python3.6/dist-packages/google/colab/drive.py in mount(mountpoint, force_remount, timeout_ms)
69
70 if ' ' in mountpoint:
---> 71 raise ValueError('Mountpoint must not contain a space.')
72
73 mountpoint = _os.path.expanduser(mountpoint)
ValueError: Mountpoint must not contain a space.
如何摆脱这个错误。这是我尝试过的:
from google.colab import drive
drive.mount('content/gdrive/My Drive/kaggle')
答案 0 :(得分:0)
这对我有用:
from google.colab import drive
drive.mount('/gdrive')
按照提示进行身份验证,然后
# remember to escape white spaces
%cd /gdrive/My\ Drive/name_of_your_folder_in_drive
答案 1 :(得分:-1)
你不应该在路径名中使用空格,所以试着输入“Mydrive”来代替“My drive”
drive.mount('content/gdrive/MyDrive/kaggle')
或者简单地说:
完成这些步骤后,您可以使用导航到所需的文件夹
! cd /folder(or path)
您也可以使用 pwd
来显示您的绝对路径,ls
来显示 currant 文件夹的内容。
注意 !
用于在 colab 中激活命令提示符代码
希望能帮到你