wannesm / dtaidistance

Time series distances: Dynamic Time Warping (fast DTW implementation in C)
Other
1.08k stars 184 forks source link

Cannot import OMP-based library on mac osx by installing thorugh pip #217

Open lllaurensss opened 1 month ago

lllaurensss commented 1 month ago

Hello i'm trying to install dtaidistance library but it keeps on failing. After reading some other (solved) bugs i decided to create a new ticket as the solutions provided were not able to solve it. When i install dtaidistance through pip it seems installed but when i test the installation i throws the following error:

Python 3.10.14 (main, Mar 19 2024, 21:46:16) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin Type "help", "copyright", "credits" or "license" for more information.

import dtaidistance.dtw as dtw dtw.try_import_c() Cannot import OMP-based library (dtw_cc_omp) Cannot import Numpy-based library (dtw_cc_numpy)

Not all libraries are available in your installation. You can rerun the compilation from source or pip install in verbose mode: pip install -vvv --upgrade --force-reinstall --no-deps --no-binary dtaidistance dtaidistance In case you need to use an older version of numpy, compile against your current installation: pip install -vvv --upgrade --force-reinstall --no-deps --no-build-isolation --no-binary dtaidistance dtaidistance

Share the following information when submitting a bug report: == Packages ==

define _OPENMP 201811

... found OpenMP All extensions: [<setuptools.extension.Extension('dtaidistance.dtw_cc') at 0x1056a7af0>, <setuptools.extension.Extension('dtaidistance.ed_cc') at 0x105813d60>, <setuptools.extension.Extension('dtaidistance.dtw_cc_omp') at 0x1058182b0>, <setuptools.extension.Extension('dtaidistance.dtw_cc_numpy') at 0x105819cf0>]

== False

I tried several things also upgraded gcc (for what it is worth)... when i installed it through conda it did work but still i need to be able to install it through pip

wannesm commented 1 month ago

It is only the parallel version that seems to fail loading. It appears you are using clang, not gcc? If you are using homebrew, make sure to install OMP first with brew install libomp.