Part I — Foundations · Chapter 1 · Lesson 2 of 5 · 7 min read
Lesson 2: Installing and Verifying the Toolchain
Lesson level: Foundation
Purpose: Establish a clean, reproducible PeaLang v0.63 RC2 environment and prove that the language, command-line interface, standard library, specification checks, and basic execution path are working.
Learning objectives
By the end of this lesson, you should be able to:
- identify the supported runtime prerequisite;
- choose between installing a release artifact and installing from a source checkout;
- isolate PeaLang in a dedicated Python environment;
- verify the installed version and core commands;
- run a minimal .pea program; and
- diagnose common installation and command-discovery failures.
2.1 What you are installing
PeaLang v0.63 RC2 is distributed as a Python project named pealang. Its package metadata requires Python 3.10 or newer and declares the cryptography library as a runtime dependency. Installation registers two equivalent primary commands, pea and pealang, plus specialized pea-ml and pea-serve entry points.
The examples in this course use pea. If that command is not discoverable but the package is installed, pealang may be used as an equivalent primary entry point. Keep one command spelling throughout a project to make documentation and automation predictable.
2.2 Prerequisite checklist
- A supported Python installation, version 3.10 or newer
- A terminal or command prompt
- Permission to create a local virtual environment
- Either the PeaLang wheel artifact or the PeaLang v0.63 RC2 source directory
- A text editor capable of saving UTF-8 plain-text files
For reproducible learning, use a dedicated virtual environment rather than installing into the system Python environment. Isolation prevents unrelated packages from changing PeaLang’s dependency set and makes it easier to discard and rebuild the setup.
2.3 Create an isolated environment
Create a workspace directory, open a terminal there, and create a virtual environment named .venv:
Windows: python -m venv .venv
.venv\Scripts\activate
macOS or Linux: python3 -m venv .venv
source .venv/bin/activate
After activation, the terminal prompt commonly shows the environment name. More importantly, the Python and package-management commands now resolve inside the isolated environment. If your platform uses a different Python launcher, substitute the command that resolves to a supported version.
2.4 Installation option A: release artifact
Use a wheel when you want an immutable release artifact suitable for repeatable installation. From the directory containing the v0.63 RC2 wheel, install it with:
python -m pip install ./pealang-0.63.0rc2-py3-none-any.whl
The exact filename must match the artifact you received. Do not silently substitute an older wheel merely because an older filename appears in historical documentation. Confirm the package version after installation.
2.5 Installation option B: source checkout
Use the source checkout when studying implementation details or contributing changes. From the directory containing pyproject.toml, install the project in editable mode:
python -m pip install -e .
Editable installation points the environment at the working source tree. Source changes become available without rebuilding a wheel, which is convenient for development but less immutable than artifact-based installation.
Optional integrations. Features such as FastAPI serving, database drivers, cloud SDKs, SFTP, Redis, tracing, and provider-specific connectors may require extra packages and live configuration. Install them only when the corresponding lesson calls for them; the foundational language workflow should remain small and controlled.
2.6 Verify the installation
Run the following checks from the activated environment:
pea --version
pea features
pea stdlib
pea spec
Version check. The first command should identify PeaLang 0.63.0rc2. If it reports another version, stop and correct the environment before continuing.
Feature registry. The feature command lists named capabilities with stability and introduction information. This helps distinguish stable, preview, and evolving surfaces.
Standard-library manifest. The standard-library command prints structured information about available modules. It also provides early confirmation that the installed package can import its library registry.
Specification verification. The specification command runs implementation-level checks and returns success only when its report is acceptable. Treat a failure as an environment or package problem rather than ignoring it.
2.7 Create and run a smoke-test program
Create a UTF-8 text file named hello.pea with this content:
print "PeaLang toolchain ready"
Run it from the same directory:
pea run hello.pea
The expected output is:
PeaLang toolchain ready
Next, ask the checker to inspect the file:
pea check hello.pea
A successful check should return without an error diagnostic. This pair of commands verifies more than command discovery: it exercises source-file reading, parsing, execution, and static checking.
2.8 Verify the interactive environment
Start the read–evaluate–print loop:
pea repl
At the pea> prompt, enter:
print std.string.upper("pea")
The expected output is PEA. The REPL supports :help, :vars, :clear, and exit or quit. Use :clear when you want a clean interpreter state without closing the process.
2.9 Understanding command resolution
When the environment is active, the shell should find its registered command scripts before globally installed copies. A surprising version usually means the wrong environment is active or another executable appears earlier in the command search path.
If pea is not found, confirm that the environment is activated, then try pealang --version. You can also invoke the package through the selected Python environment with python -m pealang --version. If this works while pea does not, the package is present but command-script discovery is misconfigured.
2.10 Troubleshooting checklist
| Symptom | Likely cause | Corrective action |
|---|---|---|
| Unsupported Python error | Interpreter is older than 3.10 | Create the environment with a supported interpreter. |
| pea command not found | Environment is inactive or command directory is not discoverable | Activate the environment; test pealang or python -m pealang. |
| Wrong PeaLang version | A global or older installation is being resolved | Rebuild or reactivate the intended environment and reinstall RC2. |
| Dependency installation fails | Package source, proxy, certificate, or platform prerequisite problem | Use the approved artifact source and your organization’s package configuration. |
| hello.pea cannot be opened | Wrong working directory or filename | Confirm the file path and run the command from the correct directory. |
| Specification verification fails | Incomplete, mismatched, or modified installation | Reinstall from a trusted RC2 artifact or clean source checkout. |
2.11 Security and reproducibility notes
- Install packages and artifacts only from an approved source.
- Do not enable process execution merely to make a basic script run. The run command keeps it disabled unless explicitly allowed.
- Do not place credentials in source files, environment setup scripts committed to version control, or examples.
- Record the PeaLang version used by a project and retain the verified artifact or lock information needed to reproduce it.
- Treat optional integrations as separate installation decisions with their own dependency, credential, and security review.
Common mistakes
- Installing into the system interpreter: use an isolated environment so PeaLang and its dependencies do not conflict with other tools.
- Not checking which pea runs: an older copy earlier on PATH can shadow the new one. Confirm with pea --version and your shell's command lookup.
- Assuming the repository description is the release version: the public description may refer to an earlier release; trust the installed version output.
- Skipping the smoke test: a successful install does not prove the runtime works; run a small program and the REPL.
- Installing unpinned versions in shared projects: record the exact version so teammates and CI reproduce the same toolchain.
2.12 Guided practice
- Explain why a dedicated environment is preferable to a global installation.
- Compare wheel installation with editable source installation.
- Identify which verification command exposes feature stability.
- Explain what the hello.pea smoke test proves.
- Describe the difference between a missing command and a missing package.
2.13 Hands-on lab: Build a verified learning environment
Goal: Produce a small evidence record showing that your environment is ready for the remaining course.
- Create and activate a dedicated environment.
- Install PeaLang v0.63 RC2 from the wheel or source checkout.
- Record the output of pea --version.
- Run pea features, pea stdlib, and pea spec.
- Create and run hello.pea.
- Run pea check hello.pea.
- Open the REPL, evaluate the uppercase standard-library example, and exit cleanly.
Deliverable: A setup note containing the operating system, Python version, installation method, PeaLang version, smoke-test output, specification result, and any corrective action you took. Do not include secrets, private package tokens, or credential-bearing configuration.
2.14 Review questions
- What minimum Python version does the package metadata require?
- Which primary command names are registered by the package?
- When should you prefer a wheel over an editable installation?
- Why must the installed version be checked rather than inferred from a folder name?
- What do the features, stdlib, and spec commands verify?
- What does it mean if python -m pealang works but pea does not?
- Why are optional integrations postponed during foundational setup?
- Which unsafe permission remains disabled during ordinary execution unless explicitly enabled?
2.15 Applied challenge
Write a short onboarding checklist that another developer can follow without prior PeaLang knowledge. It must specify the supported interpreter, environment isolation, approved installation source, exact version check, smoke test, static check, and safe handling of optional dependencies. Test your checklist by imagining the developer already has an older global PeaLang installation.
Lesson summary
A reliable PeaLang setup begins with a supported Python interpreter, an isolated environment, and a trusted RC2 artifact or source checkout. Verification must cover the exact installed version, feature registry, standard-library manifest, specification checks, source execution, static checking, and REPL behavior. Command-discovery and version conflicts should be corrected before course work continues.
Lesson status: Approved.