Skip to content

[Bug] Kernel crush #3946

@SunYong0821

Description

@SunYong0821

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?

When I use the sc.external.pp.harmony_integrate method with vscode(ipynb), it causes a kernel crash every time.

Minimal code sample

import scanpy as sc
concat = sc.read_10x_mtx(item, var_names='gene_symbols', make_unique=True)
sc.pp.normalize_total(concat, target_sum=1e4)
sc.pp.log1p(concat)
sc.pp.highly_variable_genes(concat, n_top_genes=3000, flavor='seurat_v3')
concat.raw = concat
concat = concat[:, concat.var.highly_variable]
sc.pp.scale(concat, max_value=10)
sc.tl.pca(concat, n_comps=50)
sc.external.pp.harmony_integrate(concat, key='Sample')
concat.obsm['X_pca'] = concat.obsm['X_pca_harmony']
sc.tl.umap(concat, random_state=random)
sc.tl.leiden(concat, flavor='igraph', n_iterations=2, random_state=random)

Error output

11:28:23.758 [error] Disposing session as kernel process died ExitCode: undefined, Reason: 
11:33:38.342 [error] Error in execution (get message for cell) Error: 内核 "venv (Python 3.10.12)" 已终止。有关详细信息,请单击[此处](https://aka.ms/vscodeJupyterKernelCrash)。有关更多详细信息,请查看 Jupyter [log](command:jupyter.viewOutput)。
    > Kernel Id = .jvsc74a57bd0aac885d2aded06390ba2db5cdef13a285a5b547fccc0faf8e7c60f0ffa1268b4./work/users/<username>/xinjiang/venv/python./work/users/<username>/xinjiang/venv/python.-m#ipykernel_launcher
    > Interpreter Id = /work/users/<username>/xinjiang/venv/bin/python
    > at n.verifyKernelState (~/.vscode-server/extensions/ms-toolsai.jupyter-2025.9.1-linux-x64/dist/extension.node.js:309:81661)
    > originalException = undefined

Versions

scanpy==1.11.5
anndata==0.11.4

Details
| Dependency         | Version     |
| ------------------ | ----------- |
| prompt_toolkit     | 3.0.51      |
| python-dateutil    | 2.9.0.post0 |
| numba              | 0.61.2      |
| pillow             | 11.3.0      |
| executing          | 2.2.0       |
| charset-normalizer | 3.4.2       |
| PyYAML             | 6.0.2       |
| setuptools         | 80.9.0      |
| texttable          | 1.7.0       |
| joblib             | 1.5.1       |
| leidenalg          | 0.10.2      |
| igraph             | 0.11.9      |
| kiwisolver         | 1.4.8       |
| pytz               | 2025.2      |
| debugpy            | 1.8.14      |
| six                | 1.17.0      |
| statsmodels        | 0.14.5      |
| cycler             | 0.12.1      |
| pure_eval          | 0.2.3       |
| natsort            | 8.4.0       |
| Cython             | 3.2.4       |
| patsy              | 1.0.1       |
| parso              | 0.8.4       |
| pyarrow            | 20.0.0      |
| jedi               | 0.19.2      |
| tornado            | 6.5.1       |
| decorator          | 5.2.1       |
| stack-data         | 0.6.3       |
| h5py               | 3.14.0      |
| wcwidth            | 0.2.13      |
| asttokens          | 3.0.0       |
| ipython            | 8.37.0      |
| llvmlite           | 0.44.0      |
| psutil             | 7.0.0       |

| Component | Info                                               |
| --------- | -------------------------------------------------- |
| Python    | 3.10.12 (main, May 27 2025, 17:12:29) [GCC 11.4.0] |
| OS        | Linux-5.15.0-143-generic-x86_64-with-glibc2.35     |
| CPU       | 144 logical CPU cores, x86_64                      |
| GPU       | No GPU found                                       |
| Updated   | 2026-01-16 03:34                                   |

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions