Important note: After installation, append this line
export LD_LIBRARY_PATH=/opt/intel/oneapi/mkl/2024.1/lib:$LD_LIBRARY_PATH
in ~/.bashrc
, ~/.zshrc
, etc. In order to avoid this ImportError
.
Git Clone URL: | https://aur.archlinux.org/python-numpy-mkl.git (read-only, click to copy) |
---|---|
Package Base: | python-numpy-mkl |
Description: | Scientific tools for Python, compiled with Intel MKL |
Upstream URL: | https://numpy.org |
Keywords: | numpy |
Licenses: | BSD-3-Clause |
Conflicts: | python-numpy |
Provides: | python-numpy |
Submitter: | bred |
Maintainer: | petronny (AutoUpdateBot, carlosal1015) |
Last Packager: | AutoUpdateBot |
Votes: | 38 |
Popularity: | 0.000000 |
First Submitted: | 2012-08-25 16:55 (UTC) |
Last Updated: | 2024-12-22 08:04 (UTC) |
Important note: After installation, append this line
export LD_LIBRARY_PATH=/opt/intel/oneapi/mkl/2024.1/lib:$LD_LIBRARY_PATH
in ~/.bashrc
, ~/.zshrc
, etc. In order to avoid this ImportError
.
python-h5py
was recompiled in order to work with python-numpy-2.0
in [extra]
.
https://gitlab.archlinux.org/archlinux/packaging/packages/python-h5py/-/commit/6a1c5c71246ffe54eca041304eded13b6bea772a
The same applies here, for example: if someone is using python-scipy-mkl
compiled with python-numpy-mkl-1.x, it is not enough to build/install python-numpy-mkl-2.x. User have to rebuild python-scipy-mkl
to make it work.
I've encountered the following error with h5py, which is build against the pre 2.0 version of default NumPy from https://archlinux.org/packages/extra/x86_64/python-numpy:
numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject
meson-python is 0.16.0 now, which is incompatible with pyproject.toml
We can fix it by adding sed -i -e "s/,<0.16.0//g" pyproject.toml
to PKGBUILD.
intel-oneapi-mkl is mentioned as dependency but this package does not contain the required opt/intel/oneapi/setvars.sh, which is provided by intel-oneapi-basekit or intel-oneapi-common
Update:
to fix this issue, make sure /opt/intel/oneapi/mkl/latest/lib/intel64
is in LD_LIBRARY_PATH
.
I have the issue of loading MKL in a fresh new build.
Python 3.11.5 (main, Sep 2 2023, 14:16:33) [GCC 13.2.1 20230801] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/numpy/core/__init__.py", line 24, in <module>
from . import multiarray
File "/usr/lib/python3.11/site-packages/numpy/core/multiarray.py", line 10, in <module>
from . import overrides
File "/usr/lib/python3.11/site-packages/numpy/core/overrides.py", line 8, in <module>
from numpy.core._multiarray_umath import (
ImportError: libmkl_intel_lp64.so.2: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.11/site-packages/numpy/__init__.py", line 130, in <module>
from numpy.__config__ import show as show_config
File "/usr/lib/python3.11/site-packages/numpy/__config__.py", line 4, in <module>
from numpy.core._multiarray_umath import (
File "/usr/lib/python3.11/site-packages/numpy/core/__init__.py", line 50, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.11 from "/usr/bin/python"
* The NumPy version is: "1.26.0"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: libmkl_intel_lp64.so.2: cannot open shared object file: No such file or directory
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.11/site-packages/numpy/__init__.py", line 135, in <module>
raise ImportError(msg) from e
ImportError: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python interpreter from there.
would it be possible to update the build instructions to those in the regular numpy package? There is a recent update that solves an issue with python-statsmodels and it does not rely on setup.py
I'm not sure if this is the cause to the difference but extra-x86_64-build
will call makechrootpkg
using configurations under /usr/share/devtools
.
@petronny thanks for the response. is there any difference between building with makechrootpkg -c -r $CHROOT
and extra-x86_64-build
? becase thats the only thing that i am doing differently.
MKL detection works fine in a fresh new build with extra-x86_64-build
and https://github.com/arch4edu/cactus/actions/runs/5721640576/job/15503541160 .
INFO: blas_mkl_info:
INFO: FOUND:
INFO: libraries = ['mkl_rt', 'pthread']
INFO: library_dirs = ['/opt/intel/oneapi/mkl/2023.1.0/lib/intel64']
INFO: define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
INFO: include_dirs = ['/opt/intel/oneapi/mkl/2023.1.0', '/opt/intel/oneapi/mkl/2023.1.0/include', '/opt/intel/oneapi/mkl/2023.1.0/lib']
INFO:
INFO: FOUND:
INFO: libraries = ['mkl_rt', 'pthread']
INFO: library_dirs = ['/opt/intel/oneapi/mkl/2023.1.0/lib/intel64']
INFO: define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
INFO: include_dirs = ['/opt/intel/oneapi/mkl/2023.1.0', '/opt/intel/oneapi/mkl/2023.1.0/include', '/opt/intel/oneapi/mkl/2023.1.0/lib']
INFO:
non-existing path in 'numpy/distutils': 'site.cfg'
INFO: lapack_opt_info:
INFO: lapack_armpl_info:
INFO: libraries armpl_lp64_mp not found in ['/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/']
INFO: NOT AVAILABLE
INFO:
INFO: lapack_mkl_info:
INFO: FOUND:
INFO: libraries = ['mkl_rt', 'pthread']
INFO: library_dirs = ['/opt/intel/oneapi/mkl/2023.1.0/lib/intel64']
INFO: define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
INFO: include_dirs = ['/opt/intel/oneapi/mkl/2023.1.0', '/opt/intel/oneapi/mkl/2023.1.0/include', '/opt/intel/oneapi/mkl/2023.1.0/lib']
INFO:
INFO: FOUND:
INFO: libraries = ['mkl_rt', 'pthread']
INFO: library_dirs = ['/opt/intel/oneapi/mkl/2023.1.0/lib/intel64']
INFO: define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
INFO: include_dirs = ['/opt/intel/oneapi/mkl/2023.1.0', '/opt/intel/oneapi/mkl/2023.1.0/include', '/opt/intel/oneapi/mkl/2023.1.0/lib']
INFO:
Warning: attempted relative import with no known parent package
Pinned Comments
carlosal1015 commented on 2024-12-23 00:56 (UTC) (edited on 2024-12-23 02:07 (UTC) by carlosal1015)
Important note: After installation, append this line
in
~/.bashrc
,~/.zshrc
, etc. In order to avoid thisImportError
.petronny commented on 2022-09-28 08:28 (UTC)
Prebuilt binaries of this package can be found in arch4edu.