bytecodealliance / bytecodealliance/componentize-py

ModuleNotFoundError error

未关闭
#217 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Rust
星标
277
派生
51
平均合并
12 小时 10 分钟
30 天内合并 PR
10

描述

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?

贡献指南

打开贡献指南

调研方向

使用 plugin.py 和 wit/floria-plugins.wit 重现该命令,然后检查生成的 bindings 以及 wit_world.exports 使用的导入路径。追踪 componentize-py 尝试导入 dispatch 的原因,并验证该命令在没有 ModuleNotFoundError 的情况下完成且生成 dist/plugin.wasm。

由索引模型根据 Issue 内容生成。

评估

技术栈
python, wasm
领域
tooling
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
68/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。