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