Skip to content

R session aborts after any python code #1776

@kbruton

Description

@kbruton

I keep running into the issue of my R session crashing with any reticulate-related functions.

library(reticulate)
> sessionInfo()
R version 4.4.3 (2025-02-28)
Platform: aarch64-apple-darwin20
Running under: macOS Sequoia 15.3.2

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/Los_Angeles
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] reticulate_1.42.0

loaded via a namespace (and not attached):
 [1] digest_0.6.37     fastmap_1.2.0     xfun_0.51         Matrix_1.7-3      lattice_0.22-6   
 [6] knitr_1.50        htmltools_0.5.8.1 png_0.1-8         rmarkdown_2.29    cli_3.6.4        
[11] grid_4.4.3        compiler_4.4.3    rstudioapi_0.17.1 tools_4.4.3       evaluate_1.0.3   
[16] Rcpp_1.0.14       yaml_2.3.10       jsonlite_2.0.0    rlang_1.1.5
> use_condaenv("scicsr")
> py_config()
python:         /opt/miniconda3/envs/scicsr/bin/python
libpython:      /opt/miniconda3/envs/scicsr/lib/libpython3.9.dylib
pythonhome:     /opt/miniconda3/envs/scicsr:/opt/miniconda3/envs/scicsr
version:        3.9.15 | packaged by conda-forge | (main, Nov 22 2022, 08:48:25)  [Clang 14.0.6 ]
numpy:          /opt/miniconda3/envs/scicsr/lib/python3.9/site-packages/numpy
numpy_version:  1.23.5
NOTE: Python version was forced by use_python() function
library(sciCSR)

... Then R session aborts

If I change up the order to:

library(sciCSR)
use_condaenv("sciCSR")
py_config()

... Then R session aborts.

If I never call py_config and instead do:

library(sciCSR)
use_condaenv("sciCSR")

Followed by any call to python (e.g. import scanpy, or any sciCSR function that calls python), then R session aborts.

Any suggestions would be greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions