Use dis guide if you prefer to run everything for your own laptop.
You get two ways: (A) native Python + virtual-env or (B) VS Code Dev Container with Docker.
Choose whichever e easy for you—both go lead to the same lessons.
| Tool | Version / Notes |
|---|---|
| Python | 3.10 + (collect am from https://python.org) |
| Git | Latest (e dey come with Xcode / Git for Windows / Linux package manager) |
| VS Code | Optional but e good make you get am https://code.visualstudio.com |
| Docker Desktop | Only for Option B. Free install: https://docs.docker.com/desktop/ |
💡 Tip – Check tools for terminal:
python --version,git --version,docker --version,code --version
git clone https://github.com/<your-github>/generative-ai-for-beginners
cd generative-ai-for-beginnerspython -m venv .venv # mek one
source .venv/bin/activate # macOS / Linux
.\.venv\Scripts\activate # Windows PowerShell✅ Prompt go start with (.venv) now—that mean you dey inside the env.
pip install -r requirements.txtSkip go Section 3 for API keys
We set up dis repository and course with one development container wey get Universal runtime wey fit support Python3, .NET, Node.js and Java development. The configuration dey inside devcontainer.json file wey dey .devcontainer/ folder for root of dis repository.
Why you go choose dis? Environment na the same as Codespaces; no wahala with dependency drift.
Docker Desktop – confirm say docker --version dey work.
VS Code Remote – Containers extension (ID: ms-vscode-remote.remote-containers).
File ▸ Open Folder… → generative-ai-for-beginners
VS Code go detect .devcontainer/ and go show prompt.
Click “Reopen in Container”. Docker go build the image (≈ 3 min first time). When terminal prompt show, you dey inside the container.
Miniconda na small installer for installing Conda, Python, plus some packages.
Conda na package manager wey make am easy to set up and switch between different Python virtual environments and packages. E still good for installing packages wey no dey available via pip.
Follow the MiniConda installation guide to set am up.
conda --versionCreate new environment file (environment.yml). If you dey follow for Codespaces, create am inside .devcontainer directory, so .devcontainer/environment.yml.
Put dis snippet inside your environment.yml
name: <environment-name>
channels:
- defaults
- microsoft
dependencies:
- python=<python-version>
- openai
- python-dotenv
- pip
- pip:
- azure-ai-ml
Run the commands below for your command line/terminal
conda env create --name ai4beg --file .devcontainer/environment.yml # .devcontainer sub path na only for Codespace setups e dey apply
conda activate ai4begIf you get any problem, check the Conda environments guide.
Who dis one dey for?
Anybody wey like the classic Jupyter interface or want run notebooks without VS Code.
To start Jupyter locally, go terminal/command line, waka go the course directory, then run:
jupyter notebookor
jupyterhubDis one go start Jupyter instance and the URL to access am go show for command line window.
When you open the URL, you go see the course outline and fit waka go any *.ipynb file. For example, 08-building-search-applications/python/oai-solution.ipynb.
To keep your API keys safe and secure na important thing when you dey build any kind application. We recommend say no store any API keys directly for your code. If you put those details for public repository, e fit cause security wahala and even unwanted cost if bad person use am.
Here na step-by-step guide on how to create .env file for Python and add GITHUB_TOKEN:
-
Waka go Your Project Directory: Open your terminal or command prompt and waka go your project's root directory wey you want create
.envfile.cd path/to/your/project -
Create
.envFile: Use your preferred text editor to create new file wey dem call.env. If you dey use command line, you fit usetouch(for Unix-based systems) orecho(for Windows):Unix-based systems:
touch .env
Windows:
echo . > .env
-
Edit
.envFile: Open.envfile for text editor (e.g., VS Code, Notepad++, or any other editor). Add dis line inside the file, changeyour_github_token_hereto your real GitHub token:GITHUB_TOKEN=your_github_token_here
-
Save the File: Save the changes and close the text editor.
-
Install
python-dotenv: If you never install am before, you go need installpython-dotenvpackage to load environment variables from.envfile into your Python app. You fit install am withpip:pip install python-dotenv
-
Load Environment Variables for Your Python Script: For your Python script, use
python-dotenvpackage to load environment variables from.envfile:from dotenv import load_dotenv import os # Load environment variables from .env file load_dotenv() # Access the GITHUB_TOKEN variable github_token = os.getenv("GITHUB_TOKEN") print(github_token)
Na so e be! You don create .env file, add your GitHub token, and load am inside your Python app.
🔐 No ever commit .env—e don dey inside .gitignore.
Full provider instructions dey for providers.md.
| I want to… | Go to… |
|---|---|
| Start Lesson 1 | 01-introduction-to-genai |
| Setup an LLM Provider | providers.md |
| Meet other learners | Join our Discord |
| Symptom | Fix |
|---|---|
python not found |
Add Python to PATH or open terminal again after install |
pip cannot build wheels (Windows) |
pip install --upgrade pip setuptools wheel then try again. |
ModuleNotFoundError: dotenv |
Run pip install -r requirements.txt (env no install). |
| Docker build fails No space left | Docker Desktop ▸ Settings ▸ Resources → increase disk size. |
| VS Code dey always ask to reopen | You fit get both Options active; choose one (venv or container) |
| OpenAI 401 / 429 errors | Check OPENAI_API_KEY value / request rate limits. |
| Errors with Conda | Install Microsoft AI libraries with conda install -c microsoft azure-ai-ml |
Disclaimer: Dis document don translate wit AI translation service Co-op Translator. Even though we dey try make am correct, abeg sabi say automated translation fit get some mistakes or no too correct. Di original document wey e dey for im own language na di correct one. If na serious matter, e better make human professional translate am. We no go responsible for any wahala or wrong understanding wey fit happen because of dis translation.