United States · Grade 9 to college · Google Colab

Google Colab help for students

Google Colab runs Python in a browser tab, with nothing to install, so it suits students on school Chromebooks and anyone without admin rights on a laptop. That convenience has a cost that catches students out: your code runs on a Google machine that can disappear. Files vanish, variables reset, Drive refuses to connect, a GPU warning pops up. This page explains each one using Google's own Colab FAQ and the source code of Google's google.colab package, and says plainly what to do.

Live teaching since 2020 · 10,000+ students · Python and data science online

In short

Most Google Colab problems come from one fact: your code runs on a temporary virtual machine, not your laptop. When it is idle or reaches its limit, Colab deletes it, and uploaded files and variables go with it. Keep data in Google Drive, re-run cells from the top after a reconnect, and switch off the GPU when you do not need it. Our teen data science course at Modern Age Coders runs in Google Colab and is taught live to US high schoolers, as a group batch or private one-to-one classes.

Learn it with a teacher

Three courses where Colab is the classroom

Each uses notebooks from the first week, so students learn how the machine behind them works.

Match your problem

What went wrong in Colab, and what it usually means

Find your row. The explanations below quote the Colab FAQ, read on 17 October 2026.

Common Colab problems for students (our table, built from the Colab FAQ and google.colab source)
What you seeWhat is going onWhat to do
Runtime disconnected; variables goneThe virtual machine was idle too long or hit its lifetimeReconnect, and use Runtime, Run all
Uploaded file missing next dayIt lived on the deleted machine, not in DriveSave data files in Google Drive and mount it
drive.mount() says timed outToo many items in the top level of My DriveMove files into subfolders; empty the Trash
OSError: [Errno 5] Input/output errorA Drive folder with very many items, or a Drive quotaUse subfolders, copy one archive, or wait a day
A message that the GPU is not being usedYou chose a GPU runtime but the code does not use itSet Hardware Accelerator to None
No Gemini icon or AI suggestionsThe account is under 18, or the locale is unsupportedNothing to fix for students under 18; learn without it
A prompt to enable third-party cookiesColab shows rich output through other originsAllow googleusercontent.com in browser settings
Your file reads the wrong dataA second upload was saved as "grades (1).csv"Read the name files.upload() returns

Checked on 17 October 2026 against the Colaboratory FAQ and Google’s googlecolab/colabtools code on GitHub. Modern Age Coders has no connection with Google.

Runtimes

Why the runtime disconnects, and why your variables vanish

The Colab FAQ describes Colab as "a hosted Jupyter Notebook service that requires no setup to use". The word hosted is the key: your notebook is saved in Drive, but the code runs somewhere else.

What the FAQ says about the machine

"Code is executed in a virtual machine private to your account. Virtual machines are deleted when idle for a while, and have a maximum lifetime enforced by the Colab service."

For the free version, the FAQ says notebooks "can run for at most 12 hours, depending on availability and your usage patterns", and adds that "Runtimes will time out if you are idle."

What that means for a homework session

Walk away for dinner and the machine may be gone when you return. The notebook text and code are safe in Drive; the variables, installed packages and uploaded files are not.

So after any reconnect, run the notebook from the top: Runtime, Run all. If it fails part way, you have found a cell that depended on something that no longer exists.

Colab limits and rules students meet, from the Colab FAQ (read 17 October 2026)
TopicWhat the FAQ says
Cost"Yes. Colab is free of charge to use."
Guarantees"Colab resources are not guaranteed and not unlimited", and Colab does not publish its usage limits
Who comes firstColab "prioritizes users who are actively programming in a notebook"
Resetting a broken machineRuntime > Disconnect and delete runtime returns the machines to their original state, and how often you can do it is limited
GPU not used"Choose Runtime > Change Runtime Type and set Hardware Accelerator to None"
LanguagesColab focuses on Python, and "Python 2 is no longer supported in Colab."
BrowsersColab is "most thoroughly tested with the latest versions of Chrome, Firefox and Safari"
A check · is the GPU doing anything?python
# Cell 3: is the GPU actually being used?  (ours)
import sys
print(sys.version)               # Python version on the VM
try:
    import torch
    print(torch.cuda.is_available())
except ImportError:
    print("torch is not installed in this runtime")

# Colab's FAQ: running in a GPU runtime "does not
# automatically mean" the GPU is used. If False, or if
# you are not training a model, switch the runtime back.

Written by us for this page; run it in your own Colab notebook. Students in a first Python class almost never need a GPU, and the FAQ warns that leaving one on counts towards GPU usage limits.

Files and Drive

Uploading data and mounting Google Drive without losing work

There are two ways to get a data file into Colab: upload it to the machine, or connect Google Drive. Uploads are quick but disappear with the machine; Drive persists. Both behave in ways the documentation spells out.

Connecting Drive · the documented waypython
# Cell 1: connect Google Drive  (ours, documented API)
from google.colab import drive
drive.mount('/content/drive')
# Colab asks you to allow access, then prints:
#   Mounted at /content/drive

# Running the cell again prints:
#   Drive already mounted at /content/drive; to attempt
#   to forcibly remount, call
#   drive.mount("/content/drive", force_remount=True).

import pandas as pd
# The source checks for a 'My Drive' folder inside
# the mount point, so your files sit under it:
df = pd.read_csv('/content/drive/My Drive/class/grades.csv')

The messages are quoted from Google’s google.colab source code, which also refuses a mount point that already holds files ("Mountpoint must not already contain files") or contains a space.

Uploading a file · and reading the right onepython
# Cell 2: upload from your laptop  (ours, documented API)
from google.colab import files
import pandas as pd

uploaded = files.upload()      # pick the file in the dialog
name = list(uploaded)[0]       # the name Colab really saved
print(name)                    # e.g. grades (1).csv
df = pd.read_csv(name)

# Uploading grades.csv twice saves the second copy as
# "grades (1).csv", so read_csv("grades.csv") would quietly
# read the OLD file. Using the returned name avoids that.

In the source, files.upload() returns "A map of the form {<filename>: <file contents>}", and a name that already exists is saved with a number in brackets before the extension. That is where "grades (1).csv" comes from.

When drive.mount() times out or fails

The FAQ explains that Drive operations "can time out when the number of files or subfolders in a folder grows too large", and that storing "more than approximately ten thousand items in the root directory can cause mounting to fail".

Its fix: move files out of the top level of My Drive into subfolders, keep each folder under ten thousand items, and empty the Trash, because deleted files may still count.

OSError: [Errno 5] and quotas

The same error can come from Drive quotas. The FAQ names accessing a popular shared file or too many files too quickly as typical causes, and suggests copying data as one .zip archive and unpacking it on the machine.

Its last suggestion is simply: "Wait a day for quota limits to reset." If a class dataset is shared with every student, make your own copy in Drive first.

A safety note the FAQ makes in so many words: "Mounting Google Drive on Colab allows any code in your notebook to access any files in your Google Drive." Only mount Drive in notebooks you trust, and be careful with notebooks a stranger shared.

School accounts and AI

School Google accounts, sharing, and the AI features

If you open Colab with a school Google account, the school's settings change what you can see and use. The Colab FAQ covers that directly.

Accounts, sharing and AI in Colab, from the Colab FAQ (read 17 October 2026)
QuestionWhat the FAQ saysWhat it means for a student
Can I use Colab with my school account?Workspace access is "controlled by the Workspace on/off control" set by the school's administratorIf Colab will not open on a school account, the school decides
Do under-18 students need permission?Workspace for Education organizations "are required to obtain parental consent" for students under 18 using Additional ServicesYour school may need a parent form before Colab is switched on
Why is there no Gemini button?"Access to Colab's AI features requires your Google account's age to be 18+."Under 18, the AI features are not for you; the notebook works without them
What does sharing share?Text, code, output and comments, but the virtual machine and its files "will not be shared"A classmate must re-run your setup cells and upload the data again
Can I hide my outputs?Yes: Edit, Notebook settings, "Omit code cell output when saving this notebook"Useful before sharing a notebook that printed private data
Can I bring in a Jupyter file?Yes, with "Upload notebook" from the File menuFiles from a teacher's Jupyter class open in Colab too

Our rule on AI for students under 18

Colab's own FAQ sets the AI features at 18 and over, so we do not show or recommend them to students under 18, and we do not suggest any way around that rule.

Students learn to read a traceback and fix it themselves, which is the skill the AI would otherwise skip. Adult learners in our college courses can use the features where their account allows.

Running Colab on your own computer

The Colab documentation says "Colab lets you connect to a local runtime", running the code on your own computer instead of Google's.

It also warns that with a local connection "the code you execute can read, write, and delete files on your computer." For a school notebook from a trusted teacher that may be fine; for anything else, stay on the hosted runtime.

A routine

Ten steps when a Colab notebook will not run

Our routine, in order. It works whether the problem is the machine, the files or your code.

  1. Check the connection. Look at the top right of the notebook. If it says reconnect, the machine is gone.
  2. Reconnect and run all. Use Runtime, Run all, and repair whichever cell stops the run first.
  3. Check the files. Run import os and print(os.listdir()) to see what is really on the machine.
  4. Mount Drive once, at the top of the notebook, and read data from paths under /content/drive/My Drive.
  5. Use the name Colab saved. After files.upload(), read the name it returns, not the name you remember.
  6. Install packages in a cell near the top, so a fresh machine gets them every time.
  7. Turn off the GPU unless you are training a model: Runtime, Change runtime type, None.
  8. Try another browser or allow googleusercontent.com if Colab asks about third-party cookies.
  9. As a last resort, reset. Runtime, Disconnect and delete runtime gives you a clean machine.
  10. Report real bugs with Help, Send feedback, as the FAQ directs.

Colab or Jupyter?

The FAQ says Jupyter is the open source project Colab is based on. Colab needs no install and runs on Google machines; Jupyter runs on your own computer.

Is Colab safe?

Your code runs in a machine private to your account. The risks are the ones above: notebooks that mount your Drive, and local runtimes that touch your files.

Python errors in Colab

A NameError, TypeError or IndentationError in Colab is ordinary Python. Read it the same way you would in any editor; Colab only changes where the code runs.

Beyond fixing

Working in Colab like a data scientist, not a firefighter

Every problem on this page has the same root: not knowing where the code runs and what survives. Our first term teaches that early.

Twelve classes in Colab (ours, for high school and college students, changed to suit each one)
ClassesNotebook workWhat it trains
1 to 2A first notebook with text and code cellsWhere the notebook is saved, and where it runs
3 to 4Loading a class dataset from DriveMounting Drive and using full paths
5 to 6Cleaning and charting with pandasSetup cells at the top; Run all after a reconnect
7 to 8A first machine learning modelWhen a GPU helps, and when to switch it off
9 to 10A data project of their ownSharing without leaking outputs
11 to 12Presenting the notebookA notebook anyone can rerun from the top

We teach the ideas behind each notebook so students can complete their own coursework; we do not fill in graded notebooks. For the bigger picture, see our data science course page and AI and machine learning classes in the USA.

Where a student is

Four stages of using Colab

From losing work to never worrying about it.

Stages with Google Colab (ours)
StageWhat it looks like
1. VisitorOpens a shared notebook and presses play on each cell
2. UploaderUploads files each session and loses them often
3. OrganizerKeeps data in Drive and setup cells at the top
4. BuilderWrites notebooks that run cleanly on a fresh machine

For parents

Colab is free and runs in a browser such as Chrome, so it can work on a Chromebook, which makes it a sensible tool for a school data class.

If your child is under 18, the AI features are off by Google's own rule. That is not a problem to solve.

For students

Assume the machine will vanish. Keep files in Drive and setup at the top.

After any reconnect, Run all before you trust a result.

The catalogue

Nine courses for Python, data and AI

Taught live online by a regular teacher, in a batch or one to one.

I

Teens

Ages 13 to 18

COL / TEN / 02

Teen machine learning

GPU runtimes used with care.

Open the syllabus
II

Bridging

Ages 10 and up

COL / BRG / 01

Maths through coding

Grades 5 to 10, maths in Python.

Open the syllabus

COL / BRG / 03

Problem solving for teens

Algorithms behind the analysis.

Open the syllabus
III

College and adults

Ages 18 and up

COL / PRO / 02

Data and AI analytics

For adults who do not code yet.

Open the syllabus

COL / PRO / 03

Generative AI for college

Ages 18 and up, model building.

Open the syllabus

How lessons run

Live lessons in the notebook you already use

Weekdays or weekends, flexible: choose your batch, or for a very personalised plan choose 1-on-1 at your convenience, weekend mornings or weekdays.

Weekdays

Batches after school, US time zones.

Weekends

Time for a full project session.

1-on-1

Around a class deadline or exam.

A steady teacher

The same person each class.

Your notebook

Colab, shared on screen.

Works on Chromebooks

A browser is all you need.

Concepts only

Graded work stays yours.

Every state

Live online, from home.

Batch or one to one

Fifteen to twenty, or private.

Student work

Data and Python projects from our students

Work by learners who once lost a whole notebook to a disconnected runtime. The student labs page has the rest.

NutriLife AI nutrition coach project screenshot

AI and ML

NutriLife

An AI nutrition coach that reads what you eat and works you toward a target.

by Bhavya · Open it

Misti AI chatbot for maths and coding screenshot

AI and ML

Misti

A chatbot that answers mathematics and programming questions, built and deployed by a student.

by Harshit · Open it

GuardianX AI internet safety assistant screenshot

AI and ML

GuardianX

An assistant that helps a young person recognise unsafe situations online.

by Vivaan · Open it

SkyCast weather forecast application screenshot

Web app

SkyCast

A weather forecasting site with live conditions for any location.

by Krish

Fees

Fees

Colab's free version costs nothing, and our teen data science course runs in it. You pay us only for teaching, month by month in US dollars, with no semester contract and nothing more to pay when you stop.

Free first class

USD 0

no card required

  • A free first lesson
  • Share the notebook that fails
  • No card asked
Book it

Group batch

USD 100

a month, billed in US dollars

  • Fifteen to twenty students
  • A regular teacher
  • A batch you choose
  • Paid monthly
Start here

One to one

USD 150

a month, billed in US dollars

  • One student, one teacher
  • Times that suit you
  • Your own data and goals
Enquire

What families say

Rated 4.9 across 547 Google reviews

Google reviews from parents, exactly as posted.

★★★★★

"The one step solution for my son. Modern Age Coders make learning coding so simple that kids love it. The teachers explain complex concepts clearly with practical exercises and interactive content."

Ria Mukherjee

Parent

★★★★★

"Modern Age Coders has been a game-changer for me. I struggled to grasp IT concepts and coding before joining, but their classes transformed everything. I can now confidently write complex programs with ease."

Samriddha Mondal

Student

★★★★★

"One of the most wonderful education centres out there. Education is not limited to school syllabus but focuses on skill development."

Vansh Agarwal

Student

★★★★★

"My child Dhairya is really enjoying the Modern Age Coders classes. This is his first online class and he eagerly looks forward to it. I can already see his improvement, and the teachers are very cooperative."

Sonam Oswal

Parent of Dhairya

★★★★★

"Modern Age Coders have wonderful teachers who teach in a clear, easy and practical way. The teacher boosts students' confidence and inspires them to learn without hesitation."

Sonu Goyal

Parent

★★★★★

"I highly recommend this computer coding class! The teachers are incredibly knowledgeable and passionate about coding."

Ritu Kedia

Parent

Questions students ask

Google Colab: common questions

Why does Google Colab keep disconnecting?

Colab runs your code on a virtual machine that is deleted when idle for a while and has a maximum lifetime; the free version runs for at most 12 hours. Reconnect, then run all cells from the top.

Where did my uploaded files go in Colab?

Uploaded files live on the virtual machine, which Colab deletes when it is idle or reaches its limit. Keep data files in Google Drive and mount Drive at the top of the notebook.

Why does drive.mount() time out?

Google says Drive operations can time out when a folder holds too many items, and that more than about ten thousand items in the top level of My Drive can make mounting fail. Move files into subfolders and empty the Trash.

Is Google Colab free for students?

Yes. The Colab FAQ says Colab is free of charge to use, although its resources are not guaranteed and not unlimited.

Why can I not see Gemini or AI features in Colab?

Google says access to Colab AI features requires a Google account aged 18 or over. Students under 18 will not see them, and the notebook works fully without them.

Why will Colab not open with my school account?

Access for school Workspace accounts is switched on or off by the school administrator, and Workspace for Education schools must get parental consent for students under 18. Ask your teacher.

Should I use a GPU in Colab?

Only if your code uses one, usually for training models. Google recommends switching to a standard runtime when the GPU is not used: open the Runtime menu, choose Change runtime type and set the hardware accelerator to None.

Can you finish my Colab assignment for me?

No. Graded notebooks are yours to complete; a teacher explains the concept and the error until you can finish it on your own.

When do lessons run for students in the US?

Weekdays or weekends, flexible. Choose your batch, or for a very personalised plan choose 1-on-1 at your convenience, weekend mornings or weekdays.

What does a Colab or data science course cost?

Nothing for the first lesson. After that, fees are charged a month at a time for live classes, with the figure in US dollars shown in the fees section above.

Elsewhere on this site

Related pages

Further reading for students who work in notebooks.

Coding classes in the USA

Our pages for US students, in one place.

Data science course

What a full data course includes.

AI and ML in the USA

For students ready for models.

AI tools age guide

Age rules for popular AI tools.

Reading files in Python

Paths and files, explained.

Python for 17 year olds

For high school seniors.

Jupyter Notebook errors for students

Jupyter Notebook errors students hit, what they mean, and how to fix them.

Python indentation errors explained

Every Python IndentationError message, what it means, and how to fix it.

Python turtle not working

Python turtle not working? The real errors, the fixes, and how to write text.

Start here

Book a free first lesson

Send the notebook link or describe the class it is for. In the first lesson the teacher opens it with you and finds what broke.

You can also read how our classes run, or browse our courses, each with a class-by-class outline.

WhatsApp us · +91 91233 66161 · connect@modernagecoders.com

Our teachers live in India and teach only online, so a US student needs just a browser and a quiet half hour. WhatsApp reaches us fastest.

No charge for the first lesson, and no card requested.

Want a class sooner? Book a priority demo

A priority demo is a full class of about 45 to 60 minutes. After the class the mentor sends a written skill report and a personal learning roadmap on WhatsApp. If you enrol, the demo fee is adjusted against your first month's fee. Share your demo Order ID with us on WhatsApp and we take it off.

Book a priority demo

Keep exploring Modern Age Coders

Related courses and guides

Free resources

From the blog

Start here

Free classPriority demoCall us