Run It Free in Google Colab, No Install
You have a script. Now you need somewhere to run it. Installing Python on a work or college laptop can be slow or not allowed. Google Colab solves that: it runs Python in your web browser for free, with pandas and the Excel tools already set up.
In this lesson you will open Colab, make practice Excel files, run your script and download the result. You will also learn what to do when you see an error, which happens to everyone.
What You'll Learn
- What Google Colab is and why it is the easiest place to start
- How to create a notebook and run a code cell
- How to make practice Excel files with one cell
- How to upload your files, run the script and download the result
- How to fix errors by giving them back to the AI
What Colab is
Google Colab (short for Colaboratory) is a free Google tool for running Python in a browser. You only need a Google account. Your code runs on Google's computers, not yours, so it works on any laptop, and even on a tablet.
A Colab file is called a notebook. A notebook is made of cells. A code cell holds some Python. You run a cell and its result appears right under it.
Step 1: Open a new notebook
- Go to colab.research.google.com and sign in with your Google account.
- Click New notebook.
- You will see an empty code cell with a small play button on its left.
- Click the title at the top (like "Untitled0.ipynb") and rename it, for example "Excel automation".
The notebook is saved in your Google Drive, in a folder called Colab Notebooks.
Step 2: Make practice files
Before using real work files, practice with fake ones. Paste this into the first cell and click the play button (or press Shift + Enter). It creates three small monthly sales files.
import pandas as pd
for month in ["jan", "feb", "mar"]:
table = pd.DataFrame({
"Date": pd.date_range("2026-01-01", periods=4).strftime("%Y-%m-%d"),
"Region": ["North", "South", "North", "East"],
"Product": ["Pens", "Paper", None, "Folders"],
"Units": [10, 25, 5, 8],
"Revenue": [50, 125, 25, 64],
})
table.to_excel(f"sales_{month}.xlsx", sheet_name="Sales", index=False)
print("Practice files created")
Click the folder icon on the left side of Colab. You will see sales_jan.xlsx, sales_feb.xlsx and sales_mar.xlsx. Each has one empty Product cell on purpose, so you can see the cleaning step work.
Step 3: Run your script
Click + Code to add a new cell and paste the script from the last lesson.
Because the practice files are already in Colab, you can skip the upload step. Ask the AI for a version that reads files already in the folder:
Run the new cell. You should see the row count for each file and a total. With the practice files, that is 3 rows per file after removing the empty Product rows, and 9 rows in total.
Step 4: Download the result
If your script ends with files.download(...), your browser downloads the output file. If not, open the folder panel, find the output file, click the three dots next to it and choose Download. Open it in Excel or Google Sheets and look at it.
Using your real files
When you are ready for real files:
- Use the upload step in the script, or drag files into the folder panel.
- Uploaded files are temporary. When your Colab session ends, they are deleted from Colab. Your originals on your computer are not touched.
- To keep files between sessions, store them in Google Drive and ask the AI to "read the files from my Google Drive folder called Sales". Colab will ask you to allow access to your Drive.
Before uploading anything, read the privacy section in the last lesson. Do not upload files your school or employer does not allow you to share.
When you see an error
Red text under a cell means an error. This is normal, even for programmers. Do not panic and do not guess. Do this:
- Scroll to the last line of the red text. That line usually says what went wrong.
- Copy the whole error.
- Paste it to the AI with this message:
Common errors and what they usually mean:
Most beginner errors are about names that do not match.
| Criteria | What it usually means |
|---|---|
| FileNotFoundError | The file name in the script does not match the real file, or it was not uploaded |
| KeyError: 'Revenue' | A column name is different, often extra spaces or different capitals |
| ValueError: Worksheet named 'Sales' not found | The sheet has a different name in one file |
| No module named ... | A tool is missing; run !pip install followed by its name in a cell |
What it usually means
- FileNotFoundError
- The file name in the script does not match the real file, or it was not uploaded
- KeyError: 'Revenue'
- A column name is different, often extra spaces or different capitals
- ValueError: Worksheet named 'Sales' not found
- The sheet has a different name in one file
- No module named ...
- A tool is missing; run !pip install followed by its name in a cell
Try it in this lesson
You can also try the core idea right here in your browser. This playground cannot open Excel files, so it builds two small tables in code, stacks them and removes the empty row, just like your script.
Key Takeaways
- Google Colab runs Python free in your browser with pandas already set up; you only need a Google account.
- A notebook is made of cells; run a cell with the play button or Shift + Enter.
- Practice on fake files first, then switch to real ones.
- Uploaded files are temporary; use Google Drive for files you want to keep.
- When you see an error, copy the whole thing back to the AI and ask for a plain-English explanation and a fix.
Quiz
Up next · Lesson 3 of 6
Read and Check AI-Written Code Without Being a Coder
3 min read
2 of 6 lessons done
Questions & Answers
Public questions about this lesson. The AI Tutor answers right away in your language, the FreeAcademy team checks answers, and every learner can read them.

