简体   繁体   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

I mounted my drive using我安装了我的驱动器

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

I tried to run a script using我尝试使用运行脚本

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

But got this error但是得到了这个错误

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

I think the issue is that the 'My Drive' folder has a space.我认为问题在于“我的云端硬盘”文件夹有空间。 Is there a workaround?有解决方法吗?

You need to add a backslash.您需要添加一个反斜杠。

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

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

相关问题 如何从安装的 Drive 文件夹中永久删除? - How to delete permanently from mounted Drive folder? 如何从谷歌驱动器文件夹下载文件? - How to download file from google drive folder? 将文件从已安装的 Google Drive 复制到本地 Google Colab session - Copy files from a mounted Google Drive to a local Google Colab session 将文件夹从 Google Colab 移动到 Google Drive - Moving Folder from Google Colab to Google Drive 我无法弄清楚如何自动进行 OAuth 身份验证以访问 Google Drive。 (Python) - I'm having trouble figuring out how to automate OAuth authentication to access Google Drive. (Python) 如何将包含多个文件夹的文件夹从谷歌驱动器上传到谷歌 colab - How to upload folder with multiple folders from google drive to google colab 如何使用 python 脚本在谷歌驱动器中创建和显示文件夹? - How to create and show a folder in google drive using python script? Google Colab 中挂载的 Google Drive 中的相对路径 - Relative path in Google Drive mounted in Google Colab Google云端硬盘文件夹ID - Google Drive folder ID 通过 gspread 从本地安装的驱动器中获取 Google 表格数据 - Fetching Google Sheet data from locally mounted drive via gspread
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM