bytecodealliance / bytecodealliance/componentize-py

ModuleNotFoundError error

Open
#217 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
277
Forks
51
Avg merge
12h 10m
Merged PRs (30d)
10

Description

I am using [this wit file](https://codeberg.org/tliron/floria/src/branch/main/library/assets/wit/floria-plugins.wit) and am trying this simple example (`plugin.py`):

```py
import wit_world
import wit_world.exports

class Dispatch(wit_world.exports.Dispatch):
def initialize(self, id):
pass

def dispatch(self, name, arguments, call_site):
pass
```

My command is basically this:

```sh
componentize-py \
--wit-path wit/floria-plugins.wit \
componentize \
--stub-wasi \
--python-path plugin \
--output dist/plugin.wasm \
plugin
```

The error is this:

```
Traceback (most recent call last):
File "python/bin/componentize-py", line 6, in
sys.exit(script())
~~~~~~^^
AssertionError: ModuleNotFoundError: No module named 'dispatch'

Caused by:
ModuleNotFoundError: No module named 'dispatch'
```

I tried generating the bindings and can't find anything that would cause this error. Am I doing something wrong?

Contributor guide

Open the contributing guide

Research direction

Reproduce the command with plugin.py and wit/floria-plugins.wit, then inspect the generated bindings and the import path used for wit_world.exports. Trace why componentize-py attempts to import dispatch and verify the command completes without ModuleNotFoundError and produces dist/plugin.wasm.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, wasm
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.