RustPython/RustPython

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

Aperta

#4988 aperta il 23 mag 2023

 (17 commenti) (0 reazioni) (0 assegnatari)Rust (1437 fork)batch import
A-vmC-buggood first issue

Metriche repository

Star
 (22.047 stelle)
Metriche merge PR
 (Merge medio 2g 6h) (172 PR mergiate in 30 g)

Descrizione

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

Guida contributor