Skip to content

ModuleNotFoundError when trying to build examples #259

Backlog

Description

@pedro-w

I was trying to follow the guidance in README.md to create a simple wasm file, without success. I tried with one of the examples and got the same error so I am thinking there is something wrong apart from me.

  1. Cloned the this repo (main branch, commit f6710d6)
  2. cd to examples/cli
  3. run componentize-py -d ../../wit -w wasi:cli/command@0.2.0 componentize app -o cli.wasm as stated in the README

I get

Traceback (most recent call last):
  File "<frozen runpy>", line 201, in _run_module_as_main
  File "<frozen runpy>", line 87, in _run_code
  File "C:\.venv\Scripts\componentize-py.exe\__main__.py", line 5, in <module>
    sys.exit(script())
             ~~~~~~^^
AssertionError: Traceback (most recent call last):
  File "/0/app.py", line 1, in <module>
    from wit.exports.wasi.cli_v0_2 import run, Run
ModuleNotFoundError: No module named 'wit'


Caused by:
    ModuleNotFoundError: No module named 'wit'
  • Using windows 11 (x86_64)
  • Python 3.15.2
  • componentize-py 0.25.1

I am aware that the naming of modules etc. has been changed quite recently.

Activity

  1. dicej commented on Nov 30, 2026

    @dicej
    Collaborator

    Thanks for reporting this, @pedro-w. Yeah, there are a number of significant, incompatible changes on the main branch of this repo vs. the most recent published release, hence this issue.

    To work around that, you can either:

    • git checkout v0.25.1 to get the matching Git commit for the published release,
    • build componentize-py from source on the main branch (see CONTRIBUTING.md for instructions) and use that, or
    • wait for the next release to be published (I'm planning to do that in the next week or so)

    The proper fix for this is probably to update the instructions in the main README.md and the ones in the examples to either not require any git clone at all (ideally) or specify the tag to check out (less ideally). The former option would involve publishing the required WIT interfaces to a registry that's included in componentize-py's default registry config. The foundational work for that was done in #250; the next step is to publish any non-standard WIT files required by the examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions