12

Getting Started with EvoX: Environment Setup and Usage

AI999第1课:智能演化的源流与 EvoX 的诞生背景
00:00

This page covers the shortest path from scratch to your first working EvoX environment : complete installation and basic configuration with as few commands as possible, then verify with an import and a minimal example to confirm that EvoX can actually be called by your task. Remember one thing—installing it doesn't mean it runs. You've only truly gotten started once all four steps produce real output.

EvoX Environment Setup: From Scratch to Your First Working EnvironmentInstalling it doesn't mean it runs — you've only truly gotten started once all four steps produce real outputFour-Step Getting-Started PathAI-Generated Commands: Verify Before RunningOSPython VersionCPU / GPUVerify the official package name and version matrix before running1Isolate the Environmentpython -m venv .venvsource .venv/bin/activateAvoid global dependency pollutionRebuild the whole environment if something breaks2Install EvoXpip install -U pippip install evoxFollow the official package name and versionNo red errors ≠ guaranteed to work3Basic ConfigurationPython version meets official requirementsDependency versions are mutually compatibleExplicitly use CPU or GPUFix the random seed4Verify and Get Startedimport evoxPrint the version to confirm it's loadedRun a minimal example successfullyComplete one round of evolutionary iterationAcceptance Criteria: All three checks must pass to complete your EvoX onboardingVersion number output successfullyMinimal example runs without errorsComplete one round of evolutionary iterationReproducibility boundary: Record the install commands, dependency files, and version numbers, then rebuild the environment on a new machine using the same manifest.

Step 1: Isolate First, Then Install

Before installing any package, create an isolated Python environment with venv or conda. Packages in the global environment are shared by all projects, and once versions conflict, debugging becomes extremely costly. An isolated environment is like giving EvoX its own workbench: if something breaks, just delete and rebuild it without affecting other projects.

  • Environment isolation comes first: create the environment with python -m venv .venv, then activate it (on Windows, use the activate script in the Scripts directory).
  • Upgrade the package manager first: run pip install -U pip after activation to avoid errors when an outdated pip resolves dependencies.

Step 2: Install EvoX

Installation is usually just one command: pip install evox, though you can also install via conda or from source.Package names, versions, and download sources must always follow the official release—package names from different sources may differ by only a character or two, and a typo can install the wrong package or an incompatible older version. An installation with no red errors only means it was "installed," not that it "works," so don't stop at this step.

Step 3: Keep Basic Configuration Minimal

You don't need to tune every parameter on your first attempt—just confirm four starting points: whether the Python version meets official requirements, whether dependency versions are mutually compatible, whether this experiment uses CPU or GPU, and whether the random seed is fixed. The first two determine whether the program runs correctly; the last two determine whether results can be reproduced.

Step 4: Finish with Verification

The most reliable way to validate is not to check for red errors in the terminal, but to let EvoX actually run: first import evox and print the version to confirm the package is loaded from the current environment; then run a minimal example or complete one round of evolutionary iteration to confirm it can be called correctly by your task. Only when both produce real output is the environment truly configured.

Let AI Help, but You're the Gatekeeper

You can tell AI your OS, Python version, and hardware details and have it generate installation, configuration, and troubleshooting commands—this can save a lot of time digging through docs. But be careful: any package names, version combinations, and system-level operations suggested by AI must be verified against the official documentation and version matrix before execution, especially commands that modify system configuration or uninstall dependencies.

Reproducibility boundary: record the install commands, environment dependency files, and version numbers. The most common consequence of juggling multiple environments is "runs on my machine, fails on another," and documentation is the only low-cost safeguard.

AI Prompt Example
"Ubuntu 22.04 + Python 3.10 + no GPU, installing EvoX throws a dependency conflict—please provide troubleshooting commands in minimal-intrusion order." Once you get the commands, verify the official package names and version matrix first, then run them one by one.