Importing umap throws "SystemError: CPUDispatcher(<function make_heap at 0x0000020B1ACFEE80>) returned a result with an exception set"
Author: actopozipcCreated May 19, 2026Updated May 20, 2026
Hi, When I write
import umap
it throws the error
TypeError: expected dtype object, got 'numpy.dtypes.UInt8DType'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\philip\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\\\umap\__init__.py", line 2, in <module>
from .umap_ import UMAP
File "C:\Users\philip\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\\\umap\\\umap_.py", line 48, in <module>
from pynndescent import NNDescent
File "C:\Users\philip\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pynndescent\__init__.py", line 5, in <module>
from .pynndescent_ import NNDescent, PyNNDescentTransformer
File "C:\Users\philip\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pynndescent\pynndescent_.py", line 22, in <module>
import pynndescent.sparse as sparse
File "C:\Users\philip\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pynndescent\sparse.py", line 9, in <module>
from pynndescent.utils import norm, tau_rand
File "C:\Users\philip\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pynndescent\\\utils.py", line 162, in <module>
EMPTY_GRAPH = make_heap(1, 1)
^^^^^^^^^^^^^^^
SystemError: CPUDispatcher(<function make_heap at 0x0000020B1ACFEE80>) returned a result with an exception setLooking for this error only lead to other packages throwing the same error due to mismatches with numpy, scipy or numba. However, for me as an "end-user" of umap it is quite hard to tell what actually could cause the missmatch and it would be delightful to receive some input from someone who knows it better than me.
- umap-learn version: 0.5.12
- numba version: 0.64.0
- numpy version: 1.26.4
- scipy version: 1.12.0
When creating a new fresh environment and freshly installing umap-learn, these versions:
- colorama 0.4.6
- joblib 1.5.3
- llvmlite 0.47.0
- numba 0.65.1
- numpy 2.4.6
- pip 25.0.1
- pynndescent 0.6.0
- scikit-learn 1.8.0
- scipy 1.17.1
- threadpoolctl 3.6.0
- tqdm 4.67.3
- umap-learn 0.5.12
throw me the SAME error as previously.
Source: lmcinnes/umap