How to install numba.openmp

Hi Todd,

I’ve installed PyOMP within a clean conda env: conda install -c python-for-hpc -c conda-forge --override-channels pyomp. Upon running a basic PI example, I’m getting an error: Numba needs NumPy 1.24 or less.
How do I force Numba to get the correct Numpy package associated with the installed PyOMP virtual env, rather than the one installed in my native python installation (/home/jacobs/.local/lib/python3.10/site-packages/numpy/__init__.py)?

The python interpreter comes from the installed PyOMP env:
(intel_PyOMP) jacobs@JS:~/Python_Playground$ which python3
/home/jacobs/miniforge3/envs/intel_PyOMP/bin/python3

Can you try:

*conda install -c conda-forge numpy=1.24*

*Todd*

Todd,

Thanks for the suggestion.
I believe the required Numpy packaged was installed correctly as part of the PyOMP env:

(intel_PyOMP) jacobs@JS:~/Python_Playground$ conda list | grep numb
numba                     0.57_pyomp      np1.22py3.9h84b9e52_0.57_pyomp    python-for-hpc
(intel_PyOMP) jacobs@JS:~/Python_Playground$ conda list | grep numpy
numpy                     1.24.4          py310ha4c1d20_0    conda-forge

However, upon importing the Numpy lib, it imports it from the site-packages path rather than the virtual env itself. Not sure how this relates to the Numba error.

If you look at the full numba name, it contains np1.22. This isn’t my area of expertise but something you can try until I can talk to the experts next week is to try numpy version 1.22 instead of 1.24.

Before you do that though, run python and then do “import numpy” and then “print(numpy.__file__)”.

You can try the same for numba just to verify it is correct. Then you can try the downgrade of numpy to 1.22 and then do the import of numpy and print again.

Also, can you file at issue at GitHub - Python-for-HPC/PyOMP: OpenMP for Python in Numba and let us deal with it over there.

For future reference, anybody seeing this topic should go to the other site to file issues for pyomp. PyOMP is a fork of Numba but for the sake of the Numba folks, we’d prefer to have the pyomp stuff handled at the above site.

Todd,

The numba=0.57 that comes originally with PyOMP prevents any downgrade to numpy=1.22.
I’ve tried also changing my pinned Python version from 3.10 to 3.9, but this also couldn’t be done due to numba conflicts.

Below are the printing and error for loading numpy and numba, respectively:

import numpy as np
print(np.__file__)
/home/jacobs/.local/lib/python3.10/site-packages/numpy/__init__.py
import numba as nb
ImportError: Numba needs NumPy 1.24 or less

That is, although it has numpy=1.24.4 within the virtual env, it points to the main file system. The numba cannot be load correctly.

What do you get if you do “which python”?

Hi Todd,

The python interpreter comes from the installed PyOMP env:
(intel_PyOMP) jacobs@JS:~/Python_Playground$ which python3
/home/jacobs/miniforge3/envs/intel_PyOMP/bin/python3

Just posting the solution here for others to see.

export PYTHONNOUSERSITE=1

1 Like