M Mozhi v3.7.0 code

Error reference › Import diagnostics

IMPORT001

module not found

error
verifiedverified on v3.7.0 categoryimport terminalstable code

What it means

Import resolution tries, in order: built-in native modules (math, json, web, http, fs, db, template), local library paths, and the public registry (auto-download on first use). Exhausting all paths yields this diagnostic.

Trigger condition

An import names a module that cannot be found: not a built-in module, not in `./.mozhi/libs/`, `~/.mozhi/libs/`, or the project tree.

Minimal failing example

import physics

Verified fix

import math

Built-in modules always resolve: math, json, web, http, fs, db, template.

What the interpreter prints

error[IMPORT001]: module not found
  --> app.mz:1:16
 1 | import physics
   |                 ^
   |
reason: (the exact problem, with positions)
help:   (a suggested fix appears here)
docs:   https://crossberry-in.github.io/mozhi-doc/errors/IMPORT001
Run mozhi --json run app.mz to get the same information as machine-readable JSON (schema mozhi.diagnostics.v1), or --verbose to also show grouped related diagnostics. See the CLI reference.

Suggested fix

Use a built-in module name, or put the library file in `./.mozhi/libs/<name>.mz`, or run `mozhi add <package>` for registry packages.

Related syntax

import statement

Related diagnostics

IMPORT002IMPORT003

Reference links

Limitations

Auto-download needs network access; offline environments only see local+built-in modules (the plain message lists the paths that were tried).