Skip to content
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

Could not find module #29

Open
Mark799 opened this issue Nov 6, 2023 · 2 comments
Open

Could not find module #29

Mark799 opened this issue Nov 6, 2023 · 2 comments

Comments

@Mark799
Copy link

Mark799 commented Nov 6, 2023

After running the following in Jupiter Notebook:

pip install numbalsoda

Collecting numbalsoda
  Downloading numbalsoda-0.3.4-cp39-cp39-win_amd64.whl (151 kB)
     -------------------------------------- 151.6/151.6 kB 4.4 MB/s eta 0:00:00
Requirement already satisfied: numpy in c:\users\[user]\anaconda3\lib\site-packages (from numbalsoda) (1.21.5)
Requirement already satisfied: numba in c:\users\[user]\anaconda3\lib\site-packages (from numbalsoda) (0.55.1)
Requirement already satisfied: llvmlite<0.39,>=0.38.0rc1 in c:\users\[user]\anaconda3\lib\site-packages (from numba->numbalsoda) (0.38.0)
Requirement already satisfied: setuptools in c:\users\[user]\anaconda3\lib\site-packages (from numba->numbalsoda) (63.4.1)
Installing collected packages: numbalsoda
Successfully installed numbalsoda-0.3.4
Note: you may need to restart the kernel to use updated packages.

It is not possible for me to import the package, and I get the following error message:

from numbalsoda import lsoda_sig, lsoda, dop853

FileNotFoundError: Could not find module 'C:\Users\[user]\[folder]\Gitlab\numbalsoda\numbalsoda\liblsoda.dll' (or one of its dependencies). Try using the full path with constructor syntax.
@Nicholaswogan
Copy link
Owner

Use conda to install instead. Pip just doesn’t work well for c extensions.

@davidpfister
Copy link

I just ran into the same issue.
When using dependencies, you see that libdop853.dll requires flang.dll and other clang related dependencies.
If I comment out the loading of dop853 to only use lsoda, then it works fine.

A couple of ideas here:

  • you could use gfortran with the options -static -shared (e.g. gfortran -cpp -shared -static -o libdop853.dll libdop853.f90). Running Dependencies on the dll shows 0 external dependencies besides windows libraries. The -static option takes care of statically linking libgcc, libgfortran, libquadmath...
  • Implementing some kind of lazy loading of the dll could also be beneficial. Like this you would not face the problem with dop853 when only using lsoda

PS: as a side note, you could add the chache option @cfunc(lsoda_sig, cache=True) in your examples for better perf.
PS2: Good job btw, I could reduce my simulation time from nearly 30 sec to 0.5!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants