Skip to content

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

@lllaurensss

Description

@lllaurensss

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 ==

  • Cannot import OMP-based library (dtw_cc_omp)
  • dlopen(/Users/qa/qa_projects/Site.Simulation/venv/lib/python3.10/site-packages/dtaidistance/dtw_cc_omp.cpython-310-darwin.so, 0x0002): Library not loaded: /usr/local/lib/libomp.dylib
    Referenced from: <98471F9E-8556-3226-98BC-2F461A21F1D5> /Users/qa/qa_projects/Site.Simulation/venv/lib/python3.10/site-packages/dtaidistance/dtw_cc_omp.cpython-310-darwin.so
    Reason: tried: '/usr/local/lib/libomp.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/libomp.dylib' (no such file), '/usr/local/lib/libomp.dylib' (no such file)
  • Cannot import Numpy-based library (dtw_cc_numpy)
  • dlopen(/Users/qa/qa_projects/Site.Simulation/venv/lib/python3.10/site-packages/dtaidistance/dtw_cc_numpy.cpython-310-darwin.so, 0x0002): Library not loaded: /usr/local/lib/libomp.dylib
    Referenced from: /Users/qa/qa_projects/Site.Simulation/venv/lib/python3.10/site-packages/dtaidistance/dtw_cc_numpy.cpython-310-darwin.so
    Reason: tried: '/usr/local/lib/libomp.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/libomp.dylib' (no such file), '/usr/local/lib/libomp.dylib' (no such file)
  • Numpy version: 1.23.4
  • Matplotlib version: 3.6.3
  • Scipy version: 1.10.1
    == System information ==
    namespace(name='cpython', cache_tag='cpython-310', version=sys.version_info(major=3, minor=10, micro=14, releaselevel='final', serial=0), hexversion=50990832, _multiarch='darwin')
    == Compilation information ==
    Compiler type: unix
    --noopenmp: 0
    --forceopenmp: 0
    --noxpreprocessor: 0
    --forcellvm: 0
    --forcegnugcc: 0
    --forcestatic: 0
    Cython found (during compilation)
  • Version: 3.0.10
  • Locations: <module 'Cython' from '/private/var/folders/dm/88b38gj92jj53dgxdsm12qf00000gn/T/build-env-2os_lx3p/lib/python3.10/site-packages/Cython/init.py'>
    Numpy found (during compilation):
  • Version: 1.26.4
  • Location: <module 'numpy' from '/private/var/folders/dm/88b38gj92jj53dgxdsm12qf00000gn/T/build-env-2os_lx3p/lib/python3.10/site-packages/numpy/init.py'>
    Using LLVM settings (clang)
    Checking for OpenMP availability for clang
    clang -dM -E -Xpreprocessor -fopenmp - # with stdout=-1, stderr=-1, input=, encoding=ascii

#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions