Google Colaboratory中Google共享云端硬盘挂载失效后的访问方法
Hey there! I’ve dealt with this exact same hiccup when Google swapped "Team Drives" to "Shared Drives"—took me a minute to figure out the path change, but it’s easy to fix once you know what’s up.
Here’s what you need to do:
1. Keep Using Your Existing Mount Code (No Changes Here)
First, still mount your personal Google Drive like you did before—this connects your Colab session to your Google account, which has access to the Shared Drive:
from google.colab import drive drive.mount('/content/drive/')
Go through the authorization flow as usual (copy the code, paste it into Colab, grant permissions).
2. Update the File Path to Use Shareddrives Instead of Team Drives
The big change is the directory name for shared drives. Where you used:
data = pd.read_csv('/content/drive/Team Drives/TestProject/test.csv')
You now need to replace Team Drives with Shareddrives (note: no space, it’s one word):
data = pd.read_csv('/content/drive/Shareddrives/TestProject/test.csv')
Extra Tips if You’re Still Having Issues
- Double-check the Shared Drive name: Make sure it’s spelled exactly as it appears in Google Drive (capitalization, spaces, special characters all matter). If the name has spaces, wrap the path in quotes or use backslashes to escape them.
- Verify permissions: Ensure your Google account is actually added to the Shared Drive with at least read access—if not, ask the drive owner to add you.
- Force a remount: If Colab is caching an old path, try remounting with the
force_remountflag to refresh the connection:drive.mount('/content/drive/', force_remount=True)
内容的提问来源于stack exchange,提问作者Amanda Watson
相关产品推荐
相关产品推荐

