fortran-lang / minpack

Modernized Minpack: for solving nonlinear equations and nonlinear least squares problems
https://fortran-lang.github.io/minpack/
Other
90 stars 18 forks source link

Extra hint for installing the Python bindings. #82

Open HannoSpreeuw opened 2 months ago

HannoSpreeuw commented 2 months ago

Wrt the Minpack Python bindings, the README says

If you already have a minpack installation, e.g. from conda-forge, 
you can build the Python extension module directly without cloning this repository

That conda install can be as easy as conda install -c conda-forge cminpack. The pip install command

pip install "https://github.com/fortran-lang/minpack/archive/refs/heads/main.zip#egg=minpack&subdirectory=python"

than indeed works flawlessly - I am using Python 3.12.

Perhaps this conda install command could be added to the README, since it took me a while to find cminpack; a minpack conda web search yields r-minpack.lm and not cminpack.

I am not sure if conda install conda-forge::r-minpack.lm + the pip install command would also provide the Python bindings. I guess not, but I did not try.

HannoSpreeuw commented 1 month ago

However.....this way of installing may not work:

python -c "import minpack"
Traceback (most recent call last):                                                                                      
  File "<string>", line 1, in <module>                                                                                  
  File ".../anaconda3/envs/py312/lib/python3.12/site-packages/minpack/__init__.py", line 6, in <module>         
    from .library import (                                                                                              
  File ".../anaconda3/envs/py312/lib/python3.12/site-packages/minpack/library.py", line 21, in <module>         
    from ._libminpack import ffi, lib                                                                                   
ModuleNotFoundError: No module named 'minpack._libminpack'

What is my oversight?