Nicholaswogan / numbalsoda

Python wrapper of LSODA (solving ODEs) which can be called from within numba functions.
MIT License
91 stars 9 forks source link

Could not find module #29

Open Mark799 opened 10 months ago

Mark799 commented 10 months ago

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 commented 10 months ago

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

davidpfister commented 2 months ago

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:

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!