If you want to work with files that are stored in your Google Drive with Colab Notebook, you will need to mount the drive with Colab.
In order to mount drive you will need to make use of the drive module from the goole.colab package.
Simply copy and paste the below 2 lines of python code in your Colab Notebook Code Cell and execute it.
Once you run the cell, you will see a message like below to get permit for the notebook to access your Google Drive files.
from google.colab import drive
drive.mount('/content/drive')
Once you click on "Connect to Google Drive" you will be asked to authorize certain permissions to Colab by login with your Gmail credentials.
Once done, when you click on the file icon on the left sidebar of the Colab Notebook, you should be able to see the Google drive files and folders under drive -> MyDrive.
Facing issues? Have Questions? Post them here! I am happy to answer!
Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.
Follow him on: X
You can also reach out to him via e-mail: rakesh@code2care.org
- How to upload and read csv file in Google Colab
- Resolving DNS_PROBE_FINISHED_NXDOMAIN Google Chrome Error
- Fix - ModuleNotFoundError: No module named google.colab
- Fetch More then 10 Links Per Page in Google Search Result
- Find Nearest Gas Station using Google Map App on your Phone
- How to get nest aware on iPhone
- Fix: Cannot contact reCAPTCHA. Check your connection and try again.
- Enable Dark Mode in Google Search
- How to Mount Google Drive in Colab Notebook
- [Fix] reCAPTCHA not working in Web Browser
- Google Celebrates Rosa Bonheur 200th birthday with a Google Doodle
- How to Subscribe to Google Nest Aware on iPhone
- Google Local Guide Program and Perks of Contributing to Google Maps
- How to remove disable google search blue triangle
- 86 Gmail keyboard shortcuts that you may find Advantageous
- How to insert image into Google Sheets cell
- How to Open a New Notebook in Google Colab
- Google Colab: How to read file from Google Drive
- How to Access Local Files in Google Colab
- Installing Google Cloud macOS SDK
- Turning Off Chat in Gmail
- How to do a Reverse Image Search Using Google Tools
- Google Search Console: HTTPS is invalid and might prevent it from being indexed
- How to Show Line Numbers in Google Colab Cells
- Fetch as Google Crawl Error or Redirected Status
- Create a large dummy file using Mac OS X terminal command - Mac-OS-X
- How to Change the Default Rows and Columns Size of Windows Terminal - Windows
- Solution: AWS S3 CLI Command AccessDenied - S3
- How to Set Background Wallpaper on macOS 13 Ventura - MacOS
- Delete blank lines in a file using Notepad++ - NotepadPlusPlus
- Spring Boot: Setting up JDBCTemplate with MySQL Tutorial - Java
- Fix: npm vs code eacces permission denied unlink /usr/local/bin/code - JavaScript
- FCM Messages! Testing Notifcation from Microsoft to investigate this problem [Microsoft Teams] - Microsoft