Issue Installing Seurat on R

Hi, I'm on a Mac and am trying to install Seurat, which I have used before and never had these issues. I am trying to use Seurat 4.0.2, using this code:

remotes::install_version("Seurat", "4.0.2")

But, I am getting issues getting the SeuratObject component:

Installing 1 packages: SeuratObject Warning: dependency ‘Matrix’ is not available trying URL 'https://cran.rstudio.com/src/contrib/SeuratObject_5.0.2.tar.gz' Content type 'application/x-gzip' length 749780 bytes (732 KB)

I do have Matrix installed already (version 1.3.4, and someone I work with has this exact version that works with the exact version of Seurat I'm trying to download). It says it's trying to load "SeuratObject_5.0.2.tar.gz" and I think this could be the issue, because 5.0.2 would have it go with Seurat v5, so I'm not sure why an older version of SeuratObject is not loading when I try to install an older version of Seurat.

The end of my error looks like this:

ERROR: lazy loading failed for package ‘SeuratObject’ * removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/SeuratObject’

The downloaded source packages are in ‘/private/var/folders/ry/rg1yzt75375_hp0p6qfqqvs00000gn/T/RtmpQhVmgc/downloaded_packages’

ERROR: dependencies ‘SeuratObject’, ‘spatstat.core’ are not available for package ‘Seurat’

  • removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/Seurat’

Warning messages:

1: In i.p(...) : installation of package ‘SeuratObject’ had non-zero exit status

2: In i.p(...) : installation of package ‘/var/folders/ry/rg1yzt75375_hp0p6qfqqvs00000gn/T//RtmpQhVmgc/remotes47d46818af5e/Seurat’ had non-zero exit status

Is there a way to specify the exact version of SeuratObject that I want? Or how else would I go about fixing this, thanks!

Welcome to the forum.

I think you syntax is incomplete. Seurat 5: Install from GitHub suggests

remotes::install_github("satijalab/seurat", "seurat5", quiet = TRUE)

If you are istalling from GitHub.

Otherwise I think you should be able to install from CRAN with

install.packages('Seurat')

Thanks for the response. I'm trying to not install Seurat5, because it changes things to an Assay5 format which is not compatible with all of the code I've done so far for a project, so I am looking to install Seurat Version 4.0.2.

Update: I've now finally gotten Matrix to install as well as SeuratObject version 4.0.2.
I am now trying to install Seurat with this code:

remotes::install_version(package = 'Seurat', version = package_version('4.0.2'))

I get these issues now:

ld: warning: -single_module is obsolete
ld: warning: -multiply_defined is obsolete
installing to /Library/Frameworks/R.framework/Versions/4.2/Resources/library/00LOCK-Seurat/00new/Seurat/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error: object 'integral' not found whilst loading namespace 'spatstat.core'
Execution halted
ERROR: lazy loading failed for package ‘Seurat’

  • removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/Seurat’
    Warning message:
    In i.p(...) :
    installation of package ‘/var/folders/ry/rg1yzt75375_hp0p6qfqqvs00000gn/T//RtmpQhVmgc/remotes47d41e3633f0/Seurat’ had non-zero exit status

I have manually downloaded and installed spatstat.core and have it loaded on R, so I am unsure why this is now an issue. I've been trying different versions of it, since I am unsure if only a certain one is compatible with what is needed.

I misread, sorry.

I just installed {Seurat 4.0.2} with no problems and it seems to be working. It looks like spatstat.core_2.4-4 installed automatically. At least I don't remember installing it.

I don't think I have ever seen those warnings and error before.

R version 4.4.1 (2024-06-14)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 22.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0 
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0

locale:
 [1] LC_CTYPE=en_CA.UTF-8       LC_NUMERIC=C               LC_TIME=en_CA.UTF-8       
 [4] LC_COLLATE=en_CA.UTF-8     LC_MONETARY=en_CA.UTF-8    LC_MESSAGES=en_CA.UTF-8   
 [7] LC_PAPER=en_CA.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C       

time zone: America/New_York
tzcode source: system (glibc)

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

other attached packages:
[1] SeuratObject_5.0.2 Seurat_4.0.2      

loaded via a namespace (and not attached):
  [1] RColorBrewer_1.1-3    rstudioapi_0.16.0     jsonlite_1.8.8       
  [4] magrittr_2.0.3        spatstat.utils_3.0-5  farver_2.1.2         
  [7] rmarkdown_2.27        vctrs_0.6.5           ROCR_1.0-11          
 [10] base64enc_0.1-3       htmltools_0.5.8.1     Formula_1.2-5        
 [13] sctransform_0.4.1     parallelly_1.37.1     KernSmooth_2.23-24   
 [16] htmlwidgets_1.6.4     ica_1.0-3             plyr_1.8.9           
 [19] plotly_4.10.4         zoo_1.8-12            igraph_2.0.3         
 [22] mime_0.12             lifecycle_1.0.4       pkgconfig_2.0.3      
 [25] Matrix_1.7-0          R6_2.5.1              fastmap_1.2.0        
 [28] fitdistrplus_1.1-11   future_1.33.2         shiny_1.8.1.1        
 [31] digest_0.6.36         colorspace_2.1-0      patchwork_1.2.0      
 [34] tensor_1.5            irlba_2.3.5.1         Hmisc_5.1-3          
 [37] labeling_0.4.3        progressr_0.14.0      fansi_1.0.6          
 [40] spatstat.sparse_3.0-3 httr_1.4.7            polyclip_1.10-6      
 [43] abind_1.4-5           mgcv_1.9-1            compiler_4.4.1       
 [46] withr_3.0.0           htmlTable_2.4.2       backports_1.5.0      
 [49] pak_0.7.2             MASS_7.3-61           tools_4.4.1          
 [52] foreign_0.8-86        lmtest_0.9-40         httpuv_1.6.15        
 [55] future.apply_1.11.2   clipr_0.8.0           nnet_7.3-19          
 [58] goftest_1.2-3         glue_1.7.0            nlme_3.1-165         
 [61] promises_1.3.0        grid_4.4.1            checkmate_2.3.1      
 [64] Rtsne_0.17            cluster_2.1.6         reshape2_1.4.4       
 [67] generics_0.1.3        gtable_0.3.5          spatstat.data_3.0-4  
 [70] tidyr_1.3.1           spatstat.core_2.4-4   data.table_1.15.4    
 [73] sp_2.1-4              utf8_1.2.4            spatstat.geom_3.2-9  
 [76] RcppAnnoy_0.0.22      ggrepel_0.9.5         RANN_2.6.1           
 [79] pillar_1.9.0          stringr_1.5.1         spam_2.10-0          
 [82] later_1.3.2           splines_4.4.1         dplyr_1.1.4          
 [85] lattice_0.22-6        survival_3.7-0        deldir_2.0-4         
 [88] tidyselect_1.2.1      miniUI_0.1.1.1        pbapply_1.7-2        
 [91] knitr_1.47            gridExtra_2.3         scattermore_1.2      
 [94] xfun_0.44             matrixStats_1.3.0     stringi_1.8.4        
 [97] lazyeval_0.2.2        evaluate_0.24.0       codetools_0.2-20     
[100] tibble_3.2.1          cli_3.6.3             uwot_0.2.2           
[103] rpart_4.1.23          xtable_1.8-4          reticulate_1.37.0    
[106] munsell_0.5.1         Rcpp_1.0.12           globals_0.16.3       
[109] spatstat.random_3.2-3 png_0.1-8             parallel_4.4.1       
[112] ggplot2_3.5.1         dotCall64_1.1-1       listenv_0.9.1        
[115] viridisLite_0.4.2     scales_1.3.0          ggridges_0.5.6       
[118] leiden_0.4.3.1        purrr_1.0.2           rlang_1.1.4          
[121] cowplot_1.1.3         formatR_1.14      

I just tried installing spatstat.core_2.4-4 from the repository, but I'm still getting the same "Error: object 'integral' not found whilst loading namespace 'spatstat.core'"

I have SeuratObject 5.0.2 as well so I'm not sure why mine isn't working still

Full error is still the same as before for me:

ld: warning: -single_module is obsolete
ld: warning: -multiply_defined is obsolete
installing to /Library/Frameworks/R.framework/Versions/4.2/Resources/library/00LOCK-Seurat/00new/Seurat/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error: object 'integral' not found whilst loading namespace 'spatstat.core'
Execution halted
ERROR: lazy loading failed for package ‘Seurat’

  • removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/Seurat’
    Warning message:
    In i.p(...) :
    installation of package ‘/var/folders/ry/rg1yzt75375_hp0p6qfqqvs00000gn/T//RtmpQhVmgc/remotes47d4784913e/Seurat’ had non-zero exit status

I do not know how to check but could Error: object 'integral' not found whilst loading namespace 'spatstat.core' be indicating a problem with a compiler? I was wondering if Seurat might require a specific version of C++ or Java? It seems unlikely but ….

Thanks for trying to help out! I had no issue running this months ago just on R, so I'm not sure why all these new issues I've never seen before appeared.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.