venv for js package #3189
-
|
I can't seem to find the package that contains the from pyodide import create_proxy # Was able to pip install this
from js import document # Can't find this one? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hi @anyoung-mc, No, it's not possible to install the It is possible to
|
Beta Was this translation helpful? Give feedback.
Hi @anyoung-mc,
No, it's not possible to install the
jsmodule into a native Python. Thejsmodule is a mount point for the JavaScript global scope. So for instance, we don't definedocumentinside of Pyodide. It just has the semantics of the JavaScript DOMdocumentif 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 thenfrom js import documentwill raise an import error because it is not present in these global scopes. In node you can do things likefrom js.process import stdoutbecause the node global scope has a symbol calledprocess.It is possible to
pip instal…