Setting Up Your Python Environment
The fastest way to fail at learning Python is to spend three hours fighting an installer. So we are going to skip the installer for now. In this lesson you will set up everything you need to run real Python code — for free, in your browser, in under five minutes.
What You'll Learn
- How to run Python in the browser using Google Colab (no install required)
- The difference between Colab, Jupyter, and a "real" Python install on your laptop
- How to install local Python the right way when you are ready
- Which AI assistant accounts to set up for this course
Option 1: Google Colab (Recommended for This Course)
Google Colab is a free service from Google that gives you a fully working Python environment in your browser. You write code in cells, hit run, and see the output. NumPy, pandas, matplotlib, and most other libraries you will use in this course come pre-installed.
To get started:
- Open
colab.research.google.comin your browser - Sign in with any Google account
- Click File → New notebook
- In the first cell, type:
print("Hello from Python!")
- Click the play button on the left of the cell, or press Shift + Enter
That is it. You have just run Python.
Why we recommend Colab for this course: zero setup, free GPUs available for later lessons (when we touch machine learning), and the notebook format works beautifully for trying things, getting AI help, and saving your work to Google Drive.
Option 2: Jupyter on Your Own Computer
A Jupyter notebook is the desktop equivalent of Colab — same cell-based interface, but running on your machine. You will eventually want this when you work with private data you do not want to upload to Google.
The cleanest way to install Python and Jupyter together is Anaconda or its lightweight cousin Miniconda. Both come with conda, a package manager that handles the messy parts of installing data science libraries.
# After installing Miniconda
conda create -n ai-course python=3.11
conda activate ai-course
conda install jupyter numpy pandas matplotlib seaborn scikit-learn
jupyter notebook
Two warnings for beginners:
- Use Python 3.11 or newer. Python 2 is dead. Python 3.6 and earlier are also retired.
- Always use a virtual environment (the
conda create -n ai-courseline above). This isolates your project's packages so a tutorial that needs an old version of pandas does not break your other projects.
You do not need this for the next several lessons. Stay in Colab until you have a real reason to install locally.
Option 3: VS Code (For When You Outgrow Notebooks)
For full software projects, most professionals use VS Code with the Python extension. It supports notebooks, but it shines when you start writing .py files, building command-line tools, or working with version control.
VS Code also has direct integration with GitHub Copilot and Claude (via extension), turning your editor into an AI-powered IDE. This is overkill for the first part of the course, but worth knowing about.
Set Up Your AI Assistant Accounts
You will use AI assistants throughout this course. Set up at least one of these free accounts now:
- ChatGPT —
chat.openai.com— best free coverage and has a free code-running feature called Advanced Data Analysis on the paid tier - Claude —
claude.ai— excellent at long, careful code explanations; the Projects feature lets you save reference docs - Google Gemini —
gemini.google.com— tightly integrated with Google Sheets and Colab itself, which can autocomplete code with a built-in Gemini panel - Perplexity —
perplexity.ai— best when you need to look up library docs or recent best practices with citations
For this course, free tiers are enough. If you can only pick one, ChatGPT is the most general-purpose for beginner Python.
A Practical Test Run
Open Colab. Create a new notebook. Try this in three separate cells:
Cell 1 — print a string:
print("Python is set up correctly!")
Cell 2 — do some math:
total = 0
for i in range(1, 11):
total += i
print(f"Sum of 1 to 10 is {total}")
Cell 3 — import a library:
import pandas as pd
df = pd.DataFrame({"name": ["Alice", "Bob"], "score": [95, 87]})
df
If all three cells run without errors, you are ready to move on. If you hit an error, copy the entire error message and paste it into ChatGPT or Claude with this prompt:
I am brand new to Python and using Google Colab. I tried to run this code and got the error below. Please explain what went wrong in plain English, then give me a fixed version.
That prompt is going to be your best friend for the rest of the course.
A Word About File Storage
In Colab, your notebooks live in Google Drive. To save your work:
- File → Save a copy in Drive stores the notebook permanently
- File → Download → .ipynb gives you a local copy
- File → Download → .py gives you a plain Python file (handy for sharing on GitHub)
Notebooks have a .ipynb extension. They are JSON files under the hood, but you do not need to think about that.
Key Takeaways
- Use Google Colab to start — it runs Python in your browser, no install required
- Install Anaconda/Miniconda when you need a local environment, and always use a virtual environment
- Python 3.11+ is what you want; never start a new project on Python 2 or pre-3.10
- Sign up for at least one AI assistant — ChatGPT is the strongest default
- Run the three test cells above to confirm your setup works before moving on

