-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Closed as not planned
Closed as not planned
Copy link
Labels
32 - InstallationProblems installing or compiling NumPyProblems installing or compiling NumPy
Description
Steps to reproduce:
I built the numpy from source using the intel compilers on a compute cluster
CC=icx CXX=icpx CFLAGS='-fveclib=none' python vendored-meson/meson/meson.py setup build -Denable-openmp=true --prefix=/vera/u/bipra/analysis/.venv -Dallow-noblas=false -Dblas-order=mkl -Dlapack-order=mkl -Dblas=mkl-static-lp64-iomp -Dlapack=mkl-static-lp64-iomp
CC="icx" CXX="icpx" CFLAGS='-fveclib=none' python vendored-meson/meson/meson.py install -C build
I also source the suggested Intel variables files in my ~/.bashrc
If just start a new shell session, activate my virtual environment and then do python -c "import numpy as np; print('success')"
I can import numpy.
However, open a Jupyter notebook in VSCode with the same virtual environment, and try to import numpy
import os
import h5py as h5
import numpy as np
I get import errors
Error message:
ImportError Traceback (most recent call last)
File ~/analysis/.venv/lib/python3.13/site-packages/numpy/_core/__init__.py:22
21 try:
---> 22 from . import multiarray
23 except ImportError as exc:
File ~/analysis/.venv/lib/python3.13/site-packages/numpy/_core/multiarray.py:11
9 import functools
---> 11 from . import _multiarray_umath, overrides
12 from ._multiarray_umath import * # noqa: F403
ImportError: libiomp5.so: cannot open shared object file: No such file or directory
The above exception was the direct cause of the following exception:
ImportError Traceback (most recent call last)
Cell In[2], line 6
2 from __future__ import annotations
4 import os
----> 6 import h5py as h5
7 import matplotlib.patheffects as mpe
8 import matplotlib.pyplot as plt
File ~/analysis/.venv/lib/python3.13/site-packages/h5py/__init__.py:33
30 else:
31 raise
---> 33 from . import version
35 if version.hdf5_version_tuple != version.hdf5_built_version_tuple:
36 _warn(("h5py is running against HDF5 {0} when it was built against {1}, "
37 "this may cause problems").format(
38 '{0}.{1}.{2}'.format(*version.hdf5_version_tuple),
39 '{0}.{1}.{2}'.format(*version.hdf5_built_version_tuple)
40 ))
File ~/analysis/.venv/lib/python3.13/site-packages/h5py/version.py:17
15 from . import h5 as _h5
16 import sys
---> 17 import numpy
19 # All should be integers, except pre, as validating versions is more than is
20 # needed for our use case
21 _H5PY_VERSION_CLS = namedtuple("_H5PY_VERSION_CLS",
22 "major minor bugfix pre post dev")
File ~/analysis/.venv/lib/python3.13/site-packages/numpy/__init__.py:112
109 from . import _distributor_init
111 try:
--> 112 from numpy.__config__ import show_config
113 except ImportError as e:
114 if isinstance(e, ModuleNotFoundError) and e.name == "numpy.__config__":
115 # The __config__ module itself was not found, so add this info:
File ~/analysis/.venv/lib/python3.13/site-packages/numpy/__config__.py:4
1 # This file is generated by numpy's build process
2 # It contains system_info results at the time of building this package.
3 from enum import Enum
----> 4 from numpy._core._multiarray_umath import (
5 __cpu_features__,
6 __cpu_baseline__,
7 __cpu_dispatch__,
8 )
10 __all__ = ["show_config"]
11 _built_with_meson = True
File ~/analysis/.venv/lib/python3.13/site-packages/numpy/_core/__init__.py:83
56 major, minor, *_ = sys.version_info
57 msg = f"""
58
59 IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
(...)
80 Original error was: {exc}
81 """
---> 83 raise ImportError(msg) from exc
84 finally:
85 for envkey in env_added:
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: Python 3.13 from "/u/bipra/analysis/.venv/bin/python"
* The NumPy version is: "2.4.0.dev0+git20250715.c8ec872"
and make sure that they are the versions you expect.
Please carefully study the information and documentation linked above.
This is unlikely to be a NumPy issue but will be caused by a bad install
or environment on your machine.
Original error was: libiomp5.so: cannot open shared object file: No such file or directory
Additional information:
No response
Metadata
Metadata
Assignees
Labels
32 - InstallationProblems installing or compiling NumPyProblems installing or compiling NumPy