| \n | // set up the encodings search function | \n
| \n | self.import(\"encodings\", None, 0).map_err(|import_err| { | \n
| \n | let err = self.new_runtime_error( | \n
| \n | \"Could not import encodings. Is your RUSTPYTHONPATH set? If you don't have \\ | \n
| \n | access to a consistent external environment (e.g. if you're embedding \\ | \n
| \n | rustpython in another application), try enabling the freeze-stdlib feature\" | \n
| \n | .to_owned(), | \n
| \n | ); | \n
| \n | err.set_cause(Some(import_err)); | \n
| \n | err | \n
| \n | })?; | \n
Try to use latest main branch instead of published version.
\nEven without stdlib, you have to embed a few python files. Skipping stdlib is possible but builtin-modules are necessary. https://docs.python.org/3/library/sys.html#sys.builtin_module_names
","upvoteCount":1,"url":"https://github.com/RustPython/RustPython/discussions/3805#discussioncomment-2995406"}}}-
|
I need a custom python runtime without stdlib, I saw an example of this: https://github.com/RustPython/RustPython/blob/main/examples/hello_embed.rs but the dependence How can I do the embed today? I also don't need Lines 205 to 215 in 60598b6 |
Beta Was this translation helpful? Give feedback.
-
|
Try to use latest main branch instead of published version. Even without stdlib, you have to embed a few python files. Skipping stdlib is possible but builtin-modules are necessary. https://docs.python.org/3/library/sys.html#sys.builtin_module_names |
Beta Was this translation helpful? Give feedback.
Try to use latest main branch instead of published version.
Even without stdlib, you have to embed a few python files. Skipping stdlib is possible but builtin-modules are necessary. https://docs.python.org/3/library/sys.html#sys.builtin_module_names