-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PyIodide external packages support breaks when exporting/converting the README to Web #47
Comments
Thanks for reporting ... i will check this ... |
Hi, could you provide me with a little example, that does not work for you? I used the following command, and it worked for me.
Which operating system are you using? |
I'm so sorry for this confusion on our side, you are of course correct, the two outputs are now identical... And both don't work. Here is my code: I use here that same pyodide template. The only change I've made was to bump the pyodide version to the latest (27.2), but it didn't work with the original version as well. I tried to improve the load script, so that it will load the packages properly during onload, and not only when it encounter an error (just mentioning them in the window.py_packages didn't work, so I tried to actively load them with loadPackage and I also tried making it dynamic with loadPackagesFromImports. I'll try to find that exact commit where it happened. |
We are currently working on updating the pyodide ... Their api has changed and also some requirements for webworkers ... I will come back to you soon ;-) |
Hi, I just updated the module to the latest pyodide version, you can try this out here: It will now download the python packages automatically: <!--
import: https://raw.githubusercontent.com/LiaTemplates/Pyodide/master/README.md
-->
# Pyodide
```python
import numpy as np
import matplotlib.pyplot as plt
t = np.arange(0.0, 2.0, 0.01)
s = np.sin(2 * np.pi * t)
fig, ax = plt.subplots()
ax.plot(t, s)
ax.grid(True, linestyle='-.')
ax.tick_params(labelcolor='r', labelsize='medium', width=3)
plt.show()
```
@Pyodide.eval |
Thanks for the quick answer and the fix! I've added a function - installPackagesManually - that handles the error message and installs the packages one by one, and also used the I can create a pull-request for the pyodide template, if you wish, to make it available for others as well. Here's my code:
|
Yes, of course, please make a pull request ... I was originally referring to py-script, sorry, not pyiodide ... They are using massively web workers, which currently prevented us from updating... However, since py-script is build on pyiodide, and it offers a way of embedding files into a virtual file-system, I was curious if this would be also interesting for you? |
Yes, py-script would also be interesting. |
Hello,
we've noticed that exporting/converting README to another format, such as 'web', breaks the pyiodide ability to install and import packages.
It's easy to reproduce by exporting the template - https://github.com/LiaTemplates/Pyodide - into web format, and running it. That example with numpy and matplotlib won't work any longer.
We tried updating the pyIodide version and to debug/fix the package loading script, but didn't manage to solve it. It seems that the methodology of importing packages is being broken as soon as the project is exported.
The text was updated successfully, but these errors were encountered: