Skip to content

Building RustPython Demo - ModuleNotFoundError binascii #4931

Closed

Description

@Anthial

With a self-hosted RustPython WASM Demo, built with npm run dist the import_pypi snippet does not seem to function correctly, with the following traceback (tested on two different devices, one running Windows 11 and one running Ubuntu 22.04):

Traceback (most recent call last):
  File "<wasm>", line 2, in <module>
  File "whlimport", line 2, in <module>
  File "zipfile", line 6, in <module>
ModuleNotFoundError: No module named 'binascii'

Is there a distinct discrepancy between the hosted demo at https://rustpython.github.io/demo/, and the one that can be built? I did see a similar issue about the math module potentially not being able to be imported #4233, although I'm not certain if or how that was resolved.

I'm uncertain whether this is relevant or not, but on both the Windows 11 device and the Ubuntu 22.04 device, npm run dev does not seemingly fail (since it does end up hosting the demo) but does present the error

error: failed getting Wasm module for 'D:\Users\USERNAME\Downloads\RustPython\target\wasm32-unknown-unknown\debug\rustpython_wasm.wasm'

Caused by:
    0: failed to parse input as wasm
    1: failed to parse code section
    2: locals exceed maximum (at offset 18853405)
Error: Running the wasm-bindgen CLI
Caused by: Running the wasm-bindgen CLI
Caused by: failed to execute `wasm-bindgen`: exited with exit code: 1
  full command: "C:\\Users\\USERNAME\\.cargo\\bin\\wasm-bindgen.exe" "D:\\Users\\USERNAME\\Downloads\\RustPython\\target\\wasm32-unknown-unknown\\debug\\rustpython_wasm.wasm" "--out-dir" "D:\\Users\\USERNAME\\Downloads\\RustPython\\wasm\\lib\\pkg" "--typescript" "--target" "bundler" "--out-name" "index" "--debug"
i 「wdm」: Hash: dc93d439250af29bad26
Version: webpack 4.46.0
Time: 8252ms
Built at: 27/04/2023 17:03:09

Or maybe I'm just missing something obvious, if so, I do apologise!

Activity

  1. youknowone commented on Apr 28, 2023

    @youknowone
    Member

    I am sorry. I found our recent version of rustpython-wasm has a bug not to enable stdlib correctly.

  2. youknowone commented on Apr 28, 2023

    @youknowone
    Member

    Please reopen the issue if the problem remains, thank you for reporting!

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