How to install numba.openmp

I am trying to use multithreading in numba using PyOMP. This doesn’t seem to come with standard numbs installation.

from numba.openmp import openmp_context as openmp

ModuleNotFoundError Traceback (most recent call last)
Input In [42], in
----> 1 from numba.openmp import openmp_context as openmp

ModuleNotFoundError: No module named ‘numba.openmp’`

This work appears to be based on a fork of Numba - it looks like the fork resides at GitHub - Python-for-HPC/PyOMP: OpenMP for Python in Numba

conda install numba cffi -c drtodd13 -c conda-forge --override-channels

I’m the author so please let me know if you have any problems. We are going to try to move this into mainline Numba after it is developed a bit more. In the meantime, you can use the command above.

Thank you. I have used the command, but still i get

from numba.openmp import openmp_context as openmp
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named ‘numba.openmp’

1 Like

Did you create a new, clean conda environment to do the install in? Can you try that?

@DrTodd13 I have the same problem as the post author. I tried already your solution on a new Conda environment. Do you have any more tips? :frowning:

You get the exact same error? Did you activate the environment after creating it? Sorry for the simplistic question but I’ve had cases where that was the problem and it’s the first thing to check. Once you’re in the environment, would you please paste the result of “conda list”? Thanks! @roxaaams

I should have asked before but what OS and architectures are your machines? We only support Linux on x64 at the moment. The following tweaked command is better because it will force numba to come from my channel and won’t fall back to conda-forge and pick-up a Numba from there that matches your OS/arch pair. I suspect that is what happened in this case. We’re working on a Windows/x64 build at the moment so that should be coming soon.

conda install drtodd13::numba cffi -c conda-forge --override-channels

I’ll try to install on linux x64 systeme with the following command :
conda install drtodd13::numba cffi -c conda-forge --override-channels
Unfortunately when I import njit from numba I obtain this error:
Traceback (most recent call last):
File “”, line 1, in
File “/soft/DL/conda_envs/omp/lib/python3.7/site-packages/numba/”, line 19, in
from numba.core import config
File “/soft/DL/conda_envs/omp/lib/python3.7/site-packages/numba/core/”, line 16, in
import llvmlite.binding as ll
File “/soft/DL/conda_envs/omp/lib/python3.7/site-packages/llvmlite/binding/”, line 4, in
from .dylib import *
File “/soft/DL/conda_envs/omp/lib/python3.7/site-packages/llvmlite/binding/”, line 3, in
from llvmlite.binding import ffi
File “/soft/DL/conda_envs/omp/lib/python3.7/site-packages/llvmlite/binding/”, line 191, in
raise OSError(“Could not load shared object file: {}”.format(_lib_name))
OSError: Could not load shared object file:

Numba works well on the same system in another installation by conda.
Thanks for your help, pyOMP seems very useful


When I tried to build PyOMP from the github project I get this error:
passmanagers.cpp:10:10: fatal error: llvm-c/Transforms/IntrinsicsOpenMP.h: No such file or directory
The IntrinsicsOpenMP.h head file not exist in the llvm-project source code

I get the same error as you when I tied to build llvmliteWithOpenmp from it’s own repository. I’m trying now to build the PyOMP project with all three git submodules checked out in the right locations.

Note that I made a pull request here to fix the git repo locations, since all except for the llvm-project had been moved ownership from @ggeorgakoudis to @Python-for-HPC.

Here are those git submodules needed. I’m not sure if that will help, but it’s where I’m at in the process of trying to build…

# .gitmodules
[submodule "llvm-project"]
path = llvm-project
url =

[submodule "llvmliteWithOpenmp"]
path = llvmliteWithOpenmp
url =

[submodule "NumbaWithOpenmp"]
path = NumbaWithOpenmp
url =

Hi I’m having the same issue as the author but I use VSCode instead of Anaconda for Python, is it possible for me to get this openmp subpackage from numba ? (I already installed numba with pip)

The best way to get Numba with OpenMP is to create a clean conda environment (I recommend Python 3.9 at this time) and run the following command:

conda install Python-for-HPC::numba Python-for-HPC::llvmlite -c conda-forge -–override-channels

If you aren’t or can’t use conda then at this point you’d need to build everything by hand which is very difficult.

Thank you very much, with a clean conda environment it seems to work well, I just have this warning at the execution of the example provided on the GitHub page :

UserWarning: llvmlite version format not recognized!
warnings.warn(“llvmlite version format not recognized!”)

However it does print the value of pi.
Do you have an idea of why I get this warning ?

You can disable the warning with

import logging;

I’ll need to fix the source and create a new version to permanently get rid of the warning. It is just because the llvmlite version format string that we generate is not what Numba uses and so Numba can’t parse it to verify that it is compatible.