Closed kethan1 closed 4 years ago
In order to use a CPython package such as psutil
, you need to install it locally with pip install psutil
, then in the Brython directory run
brython-cli --add_package psutil
From a quick look at the package, you will probably have to set the attributes sys.platform
and os.name
to be able to use it.
The option --make_package
is different, it creates Brython packages.
Thanks!
I am using Brython, and I want to use the module psutil. I ran the following command in the command prompt.
I then loaded the appropriate js scripts (brython.js, brython_stdlib.js, psutil.brython.js).
Importing Brython works fine, but when I try to do
import psutil
, anything afterimport psutil
does not work.My code is:
I ran it with the following command:
python -m http.server 8000