Skip to content
Discussion options

You must be logged in to vote

Hi @anyoung-mc,

No, it's not possible to install the js module into a native Python. The js module is a mount point for the JavaScript global scope. So for instance, we don't define document inside of Pyodide. It just has the semantics of the JavaScript DOM document if it is present in the JavaScript global scope, which happens when you are running Pyodide in the main thread of a website. If you are running Pyodide in node or a Web Worker then from js import document will raise an import error because it is not present in these global scopes. In node you can do things like from js.process import stdout because the node global scope has a symbol called process.

It is possible to pip instal…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by anyoung-mc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants