繁体   English   中英

如何从已安装的 Google 驱动器运行脚本。 问题是谷歌驱动器文件夹的名称中有一个空格

[英]How to run a script from a mounted Google drive. The issue is that the google drive folder has a space in its name

我安装了我的驱动器

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

我尝试使用运行脚本

!python /content/drive/My Drive/script.py

但是得到了这个错误

python3: can't open file '/content/drive/My': [Errno 2] No such file or directory

我认为问题在于“我的云端硬盘”文件夹有空间。 有解决方法吗?

您需要添加一个反斜杠。

!python /content/drive/My\ Drive/script.py

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM