Last modified: Oct 06, 2026

How to Install Numba in Python

Numba is a just-in-time compiler for Python. It speeds up numerical code by translating it into fast machine code[reference:0]. This guide shows you how to install Numba on your system.

Prerequisites

Before you install Numba, check your Python version. Numba currently supports Python 3.10 and later[reference:1]. You also need NumPy version 1.24 or newer.

You can check your Python version with this command.

 python --version 

Numba works on Windows, macOS, and Linux. It supports 64-bit platforms only for parallel features[reference:2].

Method 1: Install Numba with pip

The pip method is the most common way to install Numba. Open your terminal or command prompt and run this command.

 pip install numba 

This command downloads Numba and all its dependencies automatically[reference:3]. You do not need to install LLVM separately. The required LLVM components are bundled inside the llvmlite wheel[reference:4].

If you already have Numba and want to upgrade, use this command.

 pip install --upgrade numba 

To install a specific version, use the version number like this.

 pip install numba==0.61.0 

Method 2: Install Numba with conda

If you use Anaconda or Miniconda, conda is the recommended installation method. The official documentation states that conda is the easiest way to install Numba and get updates[reference:5].

Run this command in your conda environment.

 conda install numba 

To update an existing Numba installation, use this command.

 conda update numba 

You can also install Numba from the numba channel directly.

 conda install -c numba numba 

Verify Your Numba Installation

After installation, verify that Numba works correctly. Open a Python interpreter and run this code.

 import numba print(numba.__version__) 

The output shows the installed Numba version.

 0.61.0 

Now test Numba with a simple function. This example shows how to use the @jit decorator to speed up a function.

 from numba import jit import numpy as np @jit(nopython=True) def sum_array(arr): total = 0.0 for i in range(arr.shape[0]): total += arr[i] return total # Create a large array data = np.random.rand(1000000) # Call the jitted function result = sum_array(data) print(f"Sum: {result}") 

The output shows the computed sum. The first call compiles the function. Subsequent calls run at native machine code speed[reference:6].

 Sum: 500123.456789 

Common Installation Problems and Fixes

Sometimes Numba fails to import. Here are the most common issues and how to fix them.

Problem 1: Multiple Numba Versions

If you install Numba with both conda and pip, you may have conflicting versions. This causes import errors. The fix is to create a new environment and install Numba only once[reference:7].

 conda create -n numba_env python=3.11 conda activate numba_env conda install numba 

Problem 2: Python Version Mismatch

Numba may be installed for a different Python version than the one you are running. This happens when you use the wrong pip binary. Check your Python path with this command[reference:8].

 python -c "import sys; print(sys.executable)" 

Make sure the path matches the Python environment where you installed Numba.

Problem 3: Old System Libraries

On very old Linux systems, Numba may fail because the system libraries are too old. The solution is to update your operating system or its core libraries[reference:9].

Problem 4: NumPy Version Conflict

Numba requires NumPy 1.24 or newer. If you have an older NumPy version, upgrade it first.

 pip install --upgrade numpy 

Optional: Enable CUDA GPU Support

Numba can run code on NVIDIA GPUs. To enable CUDA support, install the CUDA toolkit first. With conda, use this command for CUDA 12.

 conda install -c conda-forge cuda-nvcc cuda-nvrtc "cuda-version>=12.0" 

For CUDA 11, use the cudatoolkit package instead[reference:10]. With pip, you must install the CUDA SDK from NVIDIA separately[reference:11].

After installation, verify CUDA availability with this code.

 from numba import cuda print(cuda.is_available()) 

If the output is True, your GPU is ready for Numba.

Conclusion

Installing Numba is a straightforward process. Use pip install numba for a quick setup. Use conda install numba if you work with Anaconda. Always verify the installation by importing Numba and checking its version.

Numba is a powerful tool for accelerating Python code. It works best with numerical functions, loops, and NumPy arrays[reference:12]. Once installed, you can start using decorators like @jit to speed up your code immediately.

If you run into problems, check for version conflicts first. Create a clean environment and install Numba with a single package manager. This solves most installation issues. With Numba installed, you are ready to write faster Python code.