PeaBox Lab › PeaLang › Learn › Chapter 1 › Lesson 2

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:

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

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

SymptomLikely causeCorrective action
Unsupported Python errorInterpreter is older than 3.10Create the environment with a supported interpreter.
pea command not foundEnvironment is inactive or command directory is not discoverableActivate the environment; test pealang or python -m pealang.
Wrong PeaLang versionA global or older installation is being resolvedRebuild or reactivate the intended environment and reinstall RC2.
Dependency installation failsPackage source, proxy, certificate, or platform prerequisite problemUse the approved artifact source and your organization’s package configuration.
hello.pea cannot be openedWrong working directory or filenameConfirm the file path and run the command from the correct directory.
Specification verification failsIncomplete, mismatched, or modified installationReinstall from a trusted RC2 artifact or clean source checkout.

2.11 Security and reproducibility notes

Common mistakes

2.12 Guided practice

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.

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

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.

← Previous Next →