Anybody Can AI

Quick Stats

Completed

0

Time Spent

0m

Streak

0

User

User

Python for AI: A Gentle Start

Setting Up and Going Further/Your Python Environment

Your Python Environment

Notebooks, pip, and envs.

Where code actually runs

Learning the language is only half the battle; you also need somewhere to run it. The good news: as an AI beginner, you can skip painful local setup entirely and start in minutes.

Notebooks: the beginner's best friend

A Jupyter notebook lets you write and run code in small cells, seeing the result of each immediately — perfect for experimenting with data:

  • Google Colab — free notebooks in your browser, with popular libraries (and even free GPUs) preinstalled. Open a tab and start coding.
  • Local Jupyter — once you want to work on your own machine, pip install jupyterlab and run it locally.

For learning AI, Colab is the path of least resistance — most tutorials and examples are notebooks.

Installing packages with pip

Python's power is its ecosystem of libraries. pip installs them:

pip install numpy pandas matplotlib

In a notebook cell, prefix it with !: !pip install pandas. Run it once and import pandas works.

Virtual environments (when you're ready)

As projects grow, different ones need different library versions. A virtual environment keeps each project's packages separate so they don't clash:

python -m venv .venv
source .venv/bin/activate     # Windows: .venv\Scripts\activate

You don't need this on day one — Colab handles it — but it's the standard once you build real projects.

Don't let setup block learning. Open a Colab notebook, pip install what you need, and write code today. You can graduate to local environments and virtualenvs once the language itself feels comfortable.

Try this: Open Google Colab, create a new notebook, and run import pandas as pd; print(pd.__version__) in a cell. Seeing it print a version number — with zero installation — removes the single biggest barrier beginners face.