Skip to content

Issue with numba/pynndescent during scrublet and pp.neighbors #3669

Open
@caseayden

Description

@caseayden

Please make sure these conditions are met

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of scanpy.
  • (optional) I have confirmed this bug exists on the main branch of scanpy.

What happened?

Hello, Whenever I try to call scrublet or pp.neighbors, I get the following error. I have tried reinstalling the environment, but it is persistent despite different python versions, etc.

Any solutions much appreciated!

Minimal code sample

sc.pp.scrublet(adata)

Error output

TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Failed in nopython mode pipeline (step: nopython frontend)
Failed in nopython mode pipeline (step: nopython frontend)
Invalid use of iternext with parameters (range_state_int64)

During: typing of intrinsic-call at /opt/anaconda3/envs/name/lib/python3.13/site-packages/pynndescent/pynndescent_.py (77)

[...]

During: Pass nopython_type_inference
During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x146c8b4c0>))
During: typing of call at /opt/anaconda3/envs/name/lib/python3.13/site-packages/pynndescent/pynndescent_.py (347)

During: resolving callee type: type(CPUDispatcher(<function init_rp_tree at 0x146c8b4c0>))
During: typing of call at /opt/anaconda3/envs/name/lib/python3.13/site-packages/pynndescent/pynndescent_.py (347)


File "../../../../../opt/anaconda3/envs/name/lib/python3.13/site-packages/pynndescent/pynndescent_.py", line 347:
def nn_descent(
    <source elided>
        if rp_tree_init:
            init_rp_tree(data, dist, current_graph, leaf_array)
            ^

During: Pass nopython_type_inference

Versions

Here is my session info:

-----
anndata             0.11.4
matplotlib          3.10.3
muon                0.1.7
numpy               2.1.3
pandas              2.3.0
scanpy              1.11.2
scipy               1.15.3
seaborn             0.13.2
session_info        v1.0.1
umap                0.5.7
-----
Click to view modules imported as dependencies
-----
IPython             9.3.0
jupyter_client      8.6.3
jupyter_core        5.8.1
jupyterlab          4.4.3
notebook            7.4.3
-----
Python 3.13.4 | packaged by Anaconda, Inc. | (main, Jun  4 2025, 10:31:26) [Clang 14.0.6 ]
macOS-15.5-arm64-arm-64bit-Mach-O
-----

Metadata

Metadata

Assignees

No one assigned

    Labels

    Triage 🩺This issue needs to be triaged by a maintainer

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions