RUSTPYTHONPATH is not set when using `Settings::default()` without clap
#4,988 创建于 2023年5月23日
仓库指标
- 星标
- (22,047 个星标)
- PR 合并指标
- (平均合并 2天 6小时) (30 天内合并 172 个 PR)
描述
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