Skip to content
\n
\n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n
// set up the encodings search function
self.import(\"encodings\", None, 0).map_err(|import_err| {
let err = self.new_runtime_error(
\"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\"
.to_owned(),
);
err.set_cause(Some(import_err));
err
})?;
\n
\n
\n

","upvoteCount":2,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"

Try to use latest main branch instead of published version.

\n

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

","upvoteCount":1,"url":"https://github.com/RustPython/RustPython/discussions/3805#discussioncomment-2995406"}}}
Discussion options

You must be logged in to vote

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

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Rafael-Conde
Comment options

@DimitrisJim
Comment options

@Rafael-Conde
Comment options

Answer selected by oovm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants