Curriculum previewThis is not your assigned passport. No identity, answers, or completion progress are stored here.How to start your passport
Handbook / labs

labs

Lab: Reproducible Python Environment

Goal: prove that a project can be installed and checked from a newly created environment using declared dependencies.

Goal: prove that a project can be installed and checked from a newly created environment using declared dependencies.

Prerequisites: Python setup and a small Python training/project repository.

Execution context: run on your local computer in Windows PowerShell, macOS zsh, or Linux Bash. Do not install Conda in Euler project/work storage.

1. Inspect The Project Contract#

Identify which files declare dependencies and commands, for example:

  • pyproject.toml;
  • environment.yml;
  • requirements.txt;
  • README.md;
  • Makefile or task configuration.

Ask an agent to explain them without editing:

Goal: explain how to recreate and verify this Python project.
Context: inspect README and dependency/build configuration.
Constraints: do not install packages or edit files.
Verification: identify the exact test and lint commands from repository evidence.
Output: environment creation, installation, and verification steps, with any
uncertainty labelled.

2. Create A Fresh Environment#

Use this fixed training-environment name so the commands work in PowerShell, zsh, and Bash without shell-specific variables:

conda create -n passport-python python=3.11 -y
conda activate passport-python
python --version
python -m pip --version

Install the project exactly as its README specifies. For a package with development extras, this may be:

python -m pip install -e '.[dev]'

Do not copy a command from this example when the repository declares a different method.

3. Verify From Declared Commands#

Typical checks are:

pytest
ruff check .

Use only commands actually supported by the repository.

4. Check Repository Cleanliness#

git status --short

The environment, caches, downloaded data, and generated results must not appear as untracked project content. Update .gitignore only for project-appropriate patterns, not to hide source files you do not understand.

Expected Result#

  • The selected Python interpreter belongs to the fresh environment.
  • Installation succeeds from declared project files.
  • Tests/checks run with recorded output.
  • Creating and using the environment does not dirty the repository.

Common Failures And Safe Recovery#

  • Wrong Python selected: deactivate, reactivate the intended environment, and recheck python --version and python -m pip --version.
  • Works only in an old environment: compare declared dependencies instead of copying the old environment wholesale.
  • GPU package fails locally: reproduce CPU functionality first; platform GPU installation is a separate requirement.

Understand Before Accepting AI Output#

  • I know which file declares each required dependency.
  • I verified the interpreter and pip belong to the same environment.
  • I ran the checks myself.
  • I can recreate the environment without relying on chat history.

Evidence#

Provide environment creation, installation, and verification commands plus their concise outcomes. Do not include package-registry tokens or environment variables containing secrets.

Ask For Help When#

Dependency declarations conflict, installation requires unpublished/private packages without documented access, or platform constraints are undocumented.