jdtuck / fdasrsf_python

elastic fda python code
http://research.tetonedge.net
BSD 3-Clause "New" or "Revised" License
52 stars 18 forks source link

install fails on v2.5.3 and higher #41

Closed joydeep-recurve closed 5 months ago

joydeep-recurve commented 6 months ago

Installation of this package fails on version 2.5.3 and higher with this stacktrace -

Traceback (most recent call last):
        File "/private/var/folders/1q/qs9846_n3bsbpg23y7c1sgdc0000gn/T/pip-build-env-bb7975du/overlay/lib/python3.12/site-packages/findblas/__init__.py", line 1006, in find_blas
          files_np = [f for f in os.listdir(path_np) if bool(re.search("blas", f))]
                                 ^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/1q/qs9846_n3bsbpg23y7c1sgdc0000gn/T/pip-build-env-bb7975du/overlay/lib/python3.12/site-packages/numpy/.libs'

....bunch of lines later....

ValueError: Could not locate MKL, OpenBLAS, BLIS, ATLAS or GSL libraries - you'll need to manually modify setup.py to add BLAS path.
jdtuck commented 5 months ago

It is not finding your blas, how are you installing it? Also on what OS and what version of Python. Otherwise recommend installing from conda.

joydeep-recurve commented 5 months ago

I'm doing a direct pip install. Its failing on Ubuntu 22.04.2, Python 3.8+ all versions. I can't use the conda version since its a dependency on a project I'm working on which is available on pypi.

The blas was automatically being installed in the version 2.5.2 and lower apparently, since that error does not crop up in those versions. Let me know if you need a more detailed stacktrace.

jdtuck commented 5 months ago

So I don't support anything lower than 3.9. And no on lower versions the blas was not a requirement for the c++ code. After version 2.5.2, we have an updated library that requires it. Please try install mkl-devel from pip before installing it and let me know.

joydeep-recurve commented 5 months ago

There's some weirdness in trying to install mkl-devel. It auto detects the version compatible to fdasrsf=2.5.9 to be mkl_devel-2018.0.3 and mkl_devel-2018.0.0. Python version I'm using is 3.9.13. It fails with this dependency conflict error -

ERROR: Cannot install gridmeter because these package versions have conflicting dependencies.

The conflict is caused by:
    mkl-devel 2018.0.3 depends on mkl==2018.0.3
    mkl-devel 2018.0.0 depends on mkl==2018.0.0

Upon trying to install both mkl-devel versions individually, these errors crop up -

ERROR: Could not find a version that satisfies the requirement mkl-include==2018.0.3 (from mkl-devel) (from versions: none)
ERROR: No matching distribution found for mkl-include==2018.0.3
ERROR: Could not find a version that satisfies the requirement mkl==2018.0.0 (from mkl-devel) (from versions: none)
ERROR: No matching distribution found for mkl==2018.0.0
jdtuck commented 5 months ago

Ugg, intel has hammered the mkl-devel package, so much fun. Can you install sudo apt-get install libopenblas-dev

joydeep-recurve commented 5 months ago

Are there any equivalent steps for installing through pip? The package is platform independent so I can't do an apt-get. Unfortunately it has to be through pip. I found this package, but it didn't do the trick. The original error still persists.

jdtuck commented 5 months ago

Can you upgrade your python 3.10 or later?

jdtuck commented 5 months ago

Also 2018 is not the latest mkl-devel on pip and from my scanning of pypi you should be finding a much later version

joydeep-recurve commented 5 months ago

The mkl install might be picking up older versions due to the python version. I'll try both python 3.10 and 3.11 and let you know how it goes.

joydeep-recurve commented 5 months ago

It just won't download any other version on pip. I created a fresh virtual environment on python 3.10.12, still stuck at the same error. I tried to install the 2022 version of mkl-devel, still same error. Something is broken on their pypi releases.

ERROR: Could not find a version that satisfies the requirement mkl-devel==2022.0.0 (from versions: 2018.0.0, 2018.0.3)
ERROR: No matching distribution found for mkl-devel==2022.0.0
jdtuck commented 5 months ago

So i just did a pip install mkl-devel on ubuntu 22 on python 3.10.12 and found the latest mkl 2024. So I am not sure its the pypi, but your system.

jdtuck commented 5 months ago
    ~  python3 --version                                                                                                                                                                                            127 ✘  jdtuck@s1020608  11:40:33 
Python 3.10.12
    ~  pip3 install mkl-devel                                                                                                                                                                                           ✔  jdtuck@s1020608  11:40:40 
Defaulting to user installation because normal site-packages is not writeable
Collecting mkl-devel
  Downloading mkl_devel-2024.1.0-py2.py3-none-manylinux1_x86_64.whl (31 kB)
Collecting mkl-include==2024.1.0
  Downloading mkl_include-2024.1.0-py2.py3-none-manylinux1_x86_64.whl (1.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.3/1.3 MB 2.4 MB/s eta 0:00:00
Collecting mkl==2024.1.0
  Downloading mkl-2024.1.0-py2.py3-none-manylinux1_x86_64.whl (202.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━╸━━━━━━━━━━━━━━━━━ 113.7/202.0 MB 2.4 MB/s eta 0:00:38
joydeep-recurve commented 5 months ago

I tried on a new machine and it does work. It was indeed a local issue. So it turns out we need to add mkl-devel as a necessary dependency for fdasrsf>2.5.2, and it works smoothly again.

Thanks for the help!

jdtuck commented 5 months ago

No problem