This guide provides command line instructions for working with projects in this DeepLearning.AI Courses repository.
- Python 3.13+ installed
- uv package manager installed (installation guide)
This repository contains multiple course directories, each with its own dependencies:
DeepLearning-AI-Courses/
├── agentic-ai/
├── acp-agent-communication-protocol/
├── claude-code-a-highly-agentic-coding-assistant/
└── jupyter-ai-coding-in-notebooks/
Each project directory contains:
pyproject.toml- Project dependencies and configurationuv.lock- Locked dependency versions.venv/- Virtual environment (auto-created, not in git)
Navigate to the specific course directory you want to work with:
cd jupyter-ai-coding-in-notebooksInstall dependencies and create virtual environment:
uv syncThis command:
- Creates a
.venv/directory in the project folder - Installs all dependencies from
pyproject.toml - Locks dependency versions in
uv.lock
Check Python version:
uv run python --versionList installed packages:
uv pip listRun any Python script using:
uv run python script_name.pyOr run Python code directly:
uv run python -c "print('Hello, World!')"Run a notebook and save results back to the file:
uv run jupyter nbconvert --to notebook --execute --inplace "notebook_name.ipynb"With extended timeout and error handling:
uv run jupyter nbconvert --to notebook --execute --inplace "notebook_name.ipynb" --ExecutePreprocessor.timeout=120 --allow-errorsLaunch interactive Jupyter Lab server:
uv run jupyter labThis opens Jupyter Lab in your browser at http://localhost:8888
uv run jupyter notebookConvert notebook to Python script:
uv run jupyter nbconvert --to python "notebook_name.ipynb"Convert to HTML:
uv run jupyter nbconvert --to html "notebook_name.ipynb"uv add package_nameExample:
uv add requestsAdd with version constraint:
uv add "requests>=2.31.0"uv remove package_nameUpdate all dependencies to latest compatible versions:
uv sync --upgradeUpdate specific package:
uv add "package_name@latest"uv pip treeThis course teaches AI-assisted coding in Jupyter notebooks using OpenAI's API.
Create a .env file in the exercise directory:
cd exercise-1
touch .envAdd your OpenAI API key:
echo "OPENAI_API_KEY=your_api_key_here" >> .env# Navigate to project root
cd jupyter-ai-coding-in-notebooks
# Execute Exercise 1
uv run jupyter nbconvert --to notebook --execute --inplace "exercise-1/L1 - Coding with Jupyter AI Lab.ipynb" --ExecutePreprocessor.timeout=120 --allow-errors
# Execute Exercise 2
uv run jupyter nbconvert --to notebook --execute --inplace "exercise-2/L2 - Book Research Assistant.ipynb" --ExecutePreprocessor.timeout=120 --allow-errorsopenai>=1.0.0- OpenAI API clientpython-dotenv>=1.0.0- Environment variable managementipykernel>=6.0.0- Jupyter kernelpandas>=2.0.0- Data analysisnbformat>=5.0.0- Notebook formatnbconvert>=7.0.0- Notebook conversionrequests>=2.31.0- HTTP library
Organized into modules with Python examples demonstrating agentic AI patterns.
cd agentic-ai
uv sync
uv run python module_name/example.pyLabs demonstrating agent communication using the ACP protocol.
cd acp-agent-communication-protocol
uv sync
# Run server example
uv run python server.py
# Run client example (in another terminal)
uv run python client.py| Command | Description |
|---|---|
uv sync |
Install dependencies and create virtual environment |
uv add <package> |
Add a new dependency |
uv remove <package> |
Remove a dependency |
uv run <command> |
Run command in virtual environment |
uv pip list |
List installed packages |
uv pip tree |
Show dependency tree |
uv sync --upgrade |
Update all dependencies |
| Command | Description |
|---|---|
uv run jupyter lab |
Start Jupyter Lab server |
uv run jupyter notebook |
Start Jupyter Notebook (classic) |
uv run jupyter nbconvert --to notebook --execute --inplace <file> |
Execute notebook |
uv run jupyter nbconvert --to python <file> |
Convert to Python script |
uv run jupyter nbconvert --to html <file> |
Convert to HTML |
If you get ModuleNotFoundError, ensure dependencies are installed:
uv syncCheck Python version:
uv run python --versionIf incorrect, ensure you have Python 3.13+ installed and uv is configured correctly.
Remove and recreate virtual environment:
rm -rf .venv
uv syncInstall/reinstall ipykernel:
uv add ipykernel
uv run python -m ipykernel install --user --name=jupyter-ai-codingIncrease timeout value:
uv run jupyter nbconvert --to notebook --execute --inplace "notebook.ipynb" --ExecutePreprocessor.timeout=300- Always use
uv run- Ensures commands run in the correct virtual environment - Sync after pulling - Run
uv syncafter pulling updates to ensure dependencies are current - Don't commit
.venv/- Virtual environment is already in.gitignore - Use relative paths - Keep notebooks and scripts portable
- Document dependencies - Update
pyproject.tomlwhen adding new requirements