-
Notifications
You must be signed in to change notification settings - Fork 48
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
No Sub-Packages of scipy
(or numpy
) can be Imported
#619
Comments
Thanks for opening an issue, I'm looking into it
I am unable to replicate this, is there an import from Numpy in particular that you see failing? |
Run in my test repo results in: |
Nice test 👍🏽 That's a one we should add in the Numpy recipe |
I read a bit too fast. Those "subpackages" it cannot import are not subpackages. Those are attributes. e.g. there is no |
I guess that's what you wanted to do: import pkgutil
import numpy
for submodule in pkgutil.iter_modules(numpy.__path__):
try:
__import__(f"numpy.{submodule.name}")
except ImportError:
print(f"failed to import {submodule.name}") |
That's weird, I can import Using the same package versions as you do. |
This is just a warning, in your screenshot, scipy was imported correctly. EDIT In order to get rid of the warning, we need to update the scipy recipe to use the latest Scipy version, a PR is opened for this but it needs fixing |
It looks like the following results in
But the following works:
|
Ok, so from my side:
I just tried this - it works for me as well. Unfortunately, I cannot even reproduce the original error in our environment (https://brightway-lca.github.io/brightway-hub/): The kernel is always 'busy', but won't execute a single cell. I tried:
I am not sure if this should be a separate issue? I couldn't find any relevant issues in the JupyterLite repo. I'm not sure how to proceed - I can't even get the JupyterLite site to even execute a cell with |
This looks very much like a cache issue. Can you try running JupyterLite in a new private window? |
After some more testing. It looks like the It may be because matplotlib and scipy are vendoring a different version of qhull? |
This worked - now I can at least reproduce the original issue (thank you 🙏). |
Bear with me, we'll get there 😄 |
Hello, hello! Can we help with this issue in any way, @martinRenou? |
...as far as I can see, the error messages (eg. here for #527) are rather non-descript. However, the configuration in |
Hey, @martinRenou - while we're still waiting for pyodide 0.24.0 to drop, could you update us on the scipy/matplotlib issue? Do you have any idea what the underlying issue could be? Could we help speed up the process? As I mentioned above, the error-messages are too non-descript for me to help you without further guidance 🙈 |
This will be fixed by #643 |
Amazing, thank you! |
You should be able to test it with |
I tried to test this just now - works fine. Many thanks for the fix! |
If I try to import a subpackage from
scipy
:in a JupyterLite environment built with
jupyter_server=2.7.1
jupyterlite-core=0.1.2
jupyterlite-xeus-python=0.9.4
I get the error:
This affects our attempt to run Brightway in JupyterLite, since we are using functions from
scipy.interpolate
.This works fine in the 0.23.4 version of Pyodide:
The text was updated successfully, but these errors were encountered: