python – Google Colab-ValueError:Mountpoint必须位于存在的目录中

python – Google Colab-ValueError:Mountpoint必须位于存在的目录中,第1张

概述我想在谷歌Colab上安装谷歌驱动器,我正在使用此命令来安装驱动器 from google.colab import drivedrive.mount('/content/drive/') 但是我收到了这个错误 ValueError Traceback (most recent call last)<ipython-input-45- 我想在谷歌Colab上安装谷歌驱动器,我正在使用此命令来安装驱动器

from Google.colab import drivedrive.mount('/content/drive/')

但是我收到了这个错误

ValueError                               Traceback (most recent call last)<ipython-input-45-9667a744255b> in <module>()       1 from Google.colab import drive ----> 2 drive.mount('content/drive/') /usr/local/lib/python3.6/dist-packages/Google/colab/drive.py in mount(mountpoint,force_remount)      99       raise ValueError('Mountpoint must either be a directory or not exist')     100     if '/' in mountpoint and not _os.path.exists(_os.path.dirname(mountpoint)): --> 101       raise ValueError('Mountpoint must be in a directory that exists')     102   except:     103     d.terminate(force=True) ValueError: Mountpoint must be in a directory that exists
解决方法 @clarky:你得到的错误是正确的,试图告诉你你对drive.mount()的使用是不正确的:drive.mount()的mountpoint参数必须是一个存在的空目录,或者一个不存在的名称存在的目录中的文件/目录,以便可以在挂载 *** 作中创建挂载点.您在drive.mount(‘content / drive /’)中使用相对路径(即content / drive /)意味着安装应该在’/ content / content / drive’进行,因为解释器的默认路径是/ content;请注意那里的doubled内容路径组件,并且您可能还没有名为/ content / content的目录,其中可以创建名为drive的挂载点.对笔记本代码的修复是使用drive.mount(‘/ content / drive’) – 注意前导/使mountpount路径绝对而不是相对. 总结

以上是内存溢出为你收集整理的python – Google Colab-ValueError:Mountpoint必须位于存在的目录中全部内容,希望文章能够帮你解决python – Google Colab-ValueError:Mountpoint必须位于存在的目录中所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1192216.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-03
下一篇 2022-06-03

发表评论

登录后才能评论

评论列表(0条)

保存