PFython / pyscript-local-runtime

164 stars 38 forks source link

Attempting matplotlib implementation within pyscript extension #1

Closed Lcohen06 closed 1 year ago

Lcohen06 commented 1 year ago

Hello, I am working on an extension where I want to display a matplotlib graph in a popup box when the extension is clicked. Thus, I have attempted to import matplotlib, using the packages tag in the py-config. According to the pyscript documentation, this is the appropriate method to install packages into pyscript. However, upon putting the import statement in the py-script, I receive an error message upon attempting to run the loaded extension. It states the following:

Traceback (most recent call last): File "/lib/python3.10/site-packages/_pyodide/_base.py", line 435, in eval_code .run(globals, locals) File "/lib/python3.10/site-packages/_pyodide/_base.py", line 304, in run coroutine = eval(self.code, globals, locals) File "", line 1, in ModuleNotFoundError: No module named 'matplotlib'

I can provide files for recreation if necessary. Please get back to me.

yusuf-wadi commented 1 year ago

Same issue, not sure how to install new modules to pyodide

PFython commented 1 year ago

I think you're confusing me with the author of pyodide... or pyscript... or both. Please look there.