hoodmane / worker-pyodide-console

An example pyodide console using a webworker
MIT License
15 stars 1 forks source link

Matplotlib #2

Open tomitrescak opened 3 years ago

tomitrescak commented 3 years ago

Hello, thanks for the amazing repo. I was wondering whether this works with matplotplib. I tried your online console but it gives error:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
ModuleNotFoundError: No module named 'matplotlib'

Also pressing ctrl+c gives another error.

[USER:echo(finalize)]: Cannot read property 'classList' of null
TypeError: Cannot read property 'classList' of null
    at S.fn.init.finalize (https://spectralsequences.com/worker-pyodide-console/
index.js:367:41)
    at Object.f.finalize (https://cdn.jsdelivr.net/npm/jquery.terminal@2.23.0/js
/jquery.terminal.min.js:46:132966)
    at S.fn.init.flush (https://cdn.jsdelivr.net/npm/jquery.terminal@2.23.0/js/j
query.terminal.min.js:46:130884)
    at S.fn.init.flush (https://cdn.jsdelivr.net/npm/jquery.terminal@2.23.0/js/j
query.terminal.min.js:46:140601)
    at https://cdn.jsdelivr.net/npm/jquery.terminal@2.23.0/js/jquery.terminal.mi
n.js:46:133761
    at unpromise (https://cdn.jsdelivr.net/npm/jquery.terminal@2.23.0/js/jquery.
terminal.min.js:46:12667)
    at https://cdn.jsdelivr.net/npm/jquery.terminal@2.23.0/js/jquery.terminal.mi
n.js:46:133723
    at unpromise (https://cdn.jsdelivr.net/npm/jquery.terminal@2.23.0/js/jquery.
terminal.min.js:46:12667)
    at t (https://cdn.jsdelivr.net/npm/jquery.terminal@2.23.0/js/jquery.terminal
.min.js:46:133398)
    at S.fn.init.echo (https://cdn.jsdelivr.net/npm/jquery.terminal@2.23.0/js/jq
uery.terminal.min.js:46:134072)
[USER:echo(finalize)]: Cannot read property 'classList' of null
TypeError: Cannot read property 'classList' of null
    at S.fn.init.finalize (https://spectralsequences.com/worker-pyodide-console/
index.js:367:41)
    at Object.f.finalize (https://cdn.jsdelivr.net/npm/jquery.terminal@2.23.0/js
/jquery.terminal.min.js:46:132966)
    at S.fn.init.flush (https://cdn.jsdelivr.net/npm/jquery.terminal@2.23.0/js/j
query.terminal.min.js:46:130884)
    at S.fn.init.flush (https://cdn.jsdelivr.net/npm/jquery.terminal@2.23.0/js/j
query.terminal.min.js:46:140601)
    at https://cdn.jsdelivr.net/npm/jquery.terminal@2.23.0/js/jquery.terminal.mi
n.js:46:133761
    at unpromise (https://cdn.jsdelivr.net/npm/jquery.terminal@2.23.0/js/jquery.
terminal.min.js:46:12667)
    at https://cdn.jsdelivr.net/npm/jquery.terminal@2.23.0/js/jquery.terminal.mi
n.js:46:133723
    at unpromise (https://cdn.jsdelivr.net/npm/jquery.terminal@2.23.0/js/jquery.
terminal.min.js:46:12667)
    at t (https://cdn.jsdelivr.net/npm/jquery.terminal@2.23.0/js/jquery.terminal
.min.js:46:133398)
    at S.fn.init.echo (https://cdn.jsdelivr.net/npm/jquery.terminal@2.23.0/js/jq
uery.terminal.min.js:46:134072)
hoodmane commented 3 years ago

I just updated the version hosted at https://spectralsequences.com/worker-pyodide-console/ to the most recent version of the code and now matplotlib import works. But I don't think it's possible to do anything useful with it without modifying things, because it is not clear where the plots should be displayed.

I have fixed the "ctrl+C raises error when input region is empty" bug.