Thanks to visit codestin.com
Credit goes to github.com

Skip to content

RUSTPYTHONPATH is not set when using Settings::default() without clap #4988

Open
@euanmacinnes

Description

@euanmacinnes

Summary

I've manually set the RUSTPYTHONPATH in the system environment variable, Rust sees the correct folder location prior to calling the
vm::Interpreter::without_stdlib(Default::default()).enter(|vm| { ..

and yet, the following error appears:

encodings initialization failed. Only utf-8 encoding will be supported.
ModuleNotFoundError: No module named 'encodings'

The above exception was the direct cause of the following exception:

RuntimeError: Could not import encodings. Is your RUSTPYTHONPATH set? If you don't have access to a consistent external environment (e.g. if you're embedding rustpython in another application), try enabling the freeze-stdlib feature

Expected

No message

Actual

encodings initialization failed. Only utf-8 encoding will be supported.
ModuleNotFoundError: No module named 'encodings'

The above exception was the direct cause of the following exception:

RuntimeError: Could not import encodings. Is your RUSTPYTHONPATH set? If you don't have access to a consistent external environment (e.g. if you're embedding rustpython in another application), try enabling the freeze-stdlib feature

Python Documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-vmArea: virtual machineC-bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions