Skip to content

"Essential initialization failed" when running example with --features freeze-stdlib #4292

Open

Description

@Gelox

I'm getting the following when running any example as such:

cargo run --example hello_embed --features freeze-stdlib
thread 'main' panicked at 'essential initialization failed; run with RUST_BACKTRACE=1 to see Python backtrace', vm/src/vm/mod.rs:283:30
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Is this intended? Why? When and how should I use freeze-stdlib?

Activity

  1. DimitrisJim commented on Nov 23, 2022

    @DimitrisJim
    Member

    Nothing has been added as frozen since hello_embed runs without_stdlib. In cases where you'd like to freeze the non-native modules you'd use with_init and call vm.add_frozen(rustpython_pylib::frozen_stdlib()) in it.

  2. DimitrisJim commented on Nov 23, 2022

    @DimitrisJim
    Member

    Note that in this case, the codecs module couldn't be loaded, if you run it after setting RUST_BACKTRACE you'll see the import error.

  3. jimmiebtlr commented on Nov 27, 2022

    @jimmiebtlr

    How did you resolve the codecs error? I'm seeing that error when using some of the examples, however the python code actually seems to run still.

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