Can't install ggpicrust2 on 4.4 R version

Hello, I am trying to install ggpicrust2 in Rstudio, it keep telling me that there are no dependencies for your version R
I have 4.4 version

I have tried several options, but still keep getting the same errors

'''
install.packages("ggpicrust2")

devtools::install_github("cafferychen777/ggpicrust2")

''' for example, I used:

if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")

pkgs <- c("phyloseq", "ALDEx2", "SummarizedExperiment", "Biobase", "devtools",
"ComplexHeatmap", "BiocGenerics", "BiocManager", "metagenomeSeq",
"Maaslin2", "edgeR", "lefser", "limma", "KEGGREST", "DESeq2")

for (pkg in pkgs) {
if (!requireNamespace(pkg, quietly = TRUE))
BiocManager::install(pkg)
}

'getOption("repos")' replaces Bioconductor standard repositories, see 'help("repositories",
package = "BiocManager")' for details.
Replacement repositories:
CRAN: https://cloud.r-project.org
Bioconductor version 3.19 (BiocManager 1.30.25), R 4.4.2 (2024-10-31)
Installing package(s) 'ALDEx2'
also installing the dependencies ‘RcppGSL’, ‘RcppZiggurat’, ‘Rfast’

trying URL 'https://cloud.r-project.org/src/contrib/RcppGSL_0.3.13.tar.gz'
Content type 'application/x-gzip' length 302527 bytes (295 KB)

downloaded 295 KB

trying URL 'https://cloud.r-project.org/src/contrib/RcppZiggurat_0.1.6.tar.gz'
Content type 'application/x-gzip' length 405526 bytes (396 KB)

downloaded 396 KB

trying URL 'https://cloud.r-project.org/src/contrib/Rfast_2.1.0.tar.gz'
Content type 'application/x-gzip' length 331500 bytes (323 KB)

downloaded 323 KB

trying URL 'https://bioconductor.org/packages/3.19/bioc/src/contrib/ALDEx2_1.36.0.tar.gz'
Content type 'application/x-gzip' length 3013549 bytes (2.9 MB)

downloaded 2.9 MB

  • installing source package ‘RcppGSL’ ...
    ** package ‘RcppGSL’ successfully unpacked and MD5 sums checked
    ** using staged installation
    checking for gsl-config... /home/alla/miniconda3/bin/gsl-config
    configure: creating ./config.status
    config.status: creating src/Makevars
    ** libs
    using C compiler: ‘gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0’
    using C++ compiler: ‘g++ (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0’
    g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG -I/home/alla/miniconda3/include -I../inst/include -I'/home/alla/R/x86_64-pc-linux-gnu-library/4.4/Rcpp/include' -fpic -g -O2 -fdebug-prefix-map=/build/r-base-LHi8Yy/r-base-4.4.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c RcppExports.cpp -o RcppExports.o
    g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG -I/home/alla/miniconda3/include -I../inst/include -I'/home/alla/R/x86_64-pc-linux-gnu-library/4.4/Rcpp/include' -fpic -g -O2 -fdebug-prefix-map=/build/r-base-LHi8Yy/r-base-4.4.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c fastLm.cpp -o fastLm.o
    gcc -I"/usr/share/R/include" -DNDEBUG -I/home/alla/miniconda3/include -I../inst/include -I'/home/alla/R/x86_64-pc-linux-gnu-library/4.4/Rcpp/include' -fpic -g -O2 -fdebug-prefix-map=/build/r-base-LHi8Yy/r-base-4.4.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c init.c -o init.o
    g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG -I/home/alla/miniconda3/include -I../inst/include -I'/home/alla/R/x86_64-pc-linux-gnu-library/4.4/Rcpp/include' -fpic -g -O2 -fdebug-prefix-map=/build/r-base-LHi8Yy/r-base-4.4.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c setErrorHandler.cpp -o setErrorHandler.o
    g++ -std=gnu++17 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o RcppGSL.so RcppExports.o fastLm.o init.o setErrorHandler.o -L/home/alla/miniconda3/lib -lgsl -lgslcblas -lm -L/usr/lib/R/lib -lR
    installing to /home/alla/R/x86_64-pc-linux-gnu-library/4.4/00LOCK-RcppGSL/00new/RcppGSL/libs
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** installing vignettes
    ** testing if installed package can be loaded from temporary location
    Error: package or namespace load failed for ‘RcppGSL’ in dyn.load(file, DLLpath = DLLpath, ...):
    unable to load shared object '/home/alla/R/x86_64-pc-linux-gnu-library/4.4/00LOCK-RcppGSL/00new/RcppGSL/libs/RcppGSL.so':
    libgsl.so.25: cannot open shared object file: No such file or directory
    Error: loading failed
    Execution halted
    ERROR: loading failed
  • removing ‘/home/alla/R/x86_64-pc-linux-gnu-library/4.4/RcppGSL’
    ERROR: dependency ‘RcppGSL’ is not available for package ‘RcppZiggurat’
  • removing ‘/home/alla/R/x86_64-pc-linux-gnu-library/4.4/RcppZiggurat’
    ERROR: dependency ‘RcppZiggurat’ is not available for package ‘Rfast’
  • removing ‘/home/alla/R/x86_64-pc-linux-gnu-library/4.4/Rfast’
    ERROR: dependency ‘Rfast’ is not available for package ‘ALDEx2’
  • removing ‘/home/alla/R/x86_64-pc-linux-gnu-library/4.4/ALDEx2’

The downloaded source packages are in
‘/tmp/Rtmp2qv0Li/downloaded_packages’
Installation paths not writeable, unable to update packages
path: /usr/lib/R/library
packages:
boot, codetools, foreign, lattice, nlme
path: /usr/lib/R/site-library
packages:
cli, glue, igraph, Rcpp, rlang
path: /usr/local/lib/R/site-library
packages:
brew, cpp11, crayon, evaluate, prettyunits, remotes, rprojroot, rstudioapi, withr
Warning messages:
1: In install.packages(...) :
installation of package ‘RcppGSL’ had non-zero exit status
2: In install.packages(...) :
installation of package ‘RcppZiggurat’ had non-zero exit status
3: In install.packages(...) :
installation of package ‘Rfast’ had non-zero exit status
4: In install.packages(...) :
installation of package ‘ALDEx2’ had non-zero exit status
'''

I also tried -

'''
BiocManager::install("RcppGSL")
'getOption("repos")' replaces Bioconductor standard repositories, see 'help("repositories",
package = "BiocManager")' for details.
Replacement repositories:
CRAN: https://cloud.r-project.org
Bioconductor version 3.20 (BiocManager 1.30.25), R 4.4.2 (2024-10-31)
Installing package(s) 'RcppGSL'
trying URL 'https://cloud.r-project.org/src/contrib/RcppGSL_0.3.13.tar.gz'
Content type 'application/x-gzip' length 302527 bytes (295 KB)

downloaded 295 KB

  • installing source package ‘RcppGSL’ ...
    ** package ‘RcppGSL’ successfully unpacked and MD5 sums checked
    ** using staged installation
    checking for gsl-config... /home/alla/miniconda3/bin/gsl-config
    configure: creating ./config.status
    config.status: creating src/Makevars
    ** libs
    using C compiler: ‘gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0’
    using C++ compiler: ‘g++ (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0’
    g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG -I/home/alla/miniconda3/include -I../inst/include -I'/home/alla/R/x86_64-pc-linux-gnu-library/4.4/Rcpp/include' -fpic -g -O2 -fdebug-prefix-map=/build/r-base-LHi8Yy/r-base-4.4.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c RcppExports.cpp -o RcppExports.o
    g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG -I/home/alla/miniconda3/include -I../inst/include -I'/home/alla/R/x86_64-pc-linux-gnu-library/4.4/Rcpp/include' -fpic -g -O2 -fdebug-prefix-map=/build/r-base-LHi8Yy/r-base-4.4.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c fastLm.cpp -o fastLm.o
    gcc -I"/usr/share/R/include" -DNDEBUG -I/home/alla/miniconda3/include -I../inst/include -I'/home/alla/R/x86_64-pc-linux-gnu-library/4.4/Rcpp/include' -fpic -g -O2 -fdebug-prefix-map=/build/r-base-LHi8Yy/r-base-4.4.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c init.c -o init.o
    g++ -std=gnu++17 -I"/usr/share/R/include" -DNDEBUG -I/home/alla/miniconda3/include -I../inst/include -I'/home/alla/R/x86_64-pc-linux-gnu-library/4.4/Rcpp/include' -fpic -g -O2 -fdebug-prefix-map=/build/r-base-LHi8Yy/r-base-4.4.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c setErrorHandler.cpp -o setErrorHandler.o
    g++ -std=gnu++17 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o RcppGSL.so RcppExports.o fastLm.o init.o setErrorHandler.o -L/home/alla/miniconda3/lib -lgsl -lgslcblas -lm -L/usr/lib/R/lib -lR
    installing to /home/alla/R/x86_64-pc-linux-gnu-library/4.4/00LOCK-RcppGSL/00new/RcppGSL/libs
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    ** help
    *** installing help indices
    ** building package indices
    ** installing vignettes
    ** testing if installed package can be loaded from temporary location
    Error: package or namespace load failed for ‘RcppGSL’ in dyn.load(file, DLLpath = DLLpath, ...):
    unable to load shared object '/home/alla/R/x86_64-pc-linux-gnu-library/4.4/00LOCK-RcppGSL/00new/RcppGSL/libs/RcppGSL.so':
    libgsl.so.25: cannot open shared object file: No such file or directory
    Error: loading failed
    Execution halted
    ERROR: loading failed
  • removing ‘/home/alla/R/x86_64-pc-linux-gnu-library/4.4/RcppGSL’

The downloaded source packages are in
‘/tmp/RtmpdI3XNc/downloaded_packages’
Installation paths not writeable, unable to update packages
path: /usr/lib/R/library
packages:
boot, codetools, foreign, lattice, nlme
path: /usr/lib/R/site-library
packages:
cli, glue, igraph, Rcpp, rlang
path: /usr/local/lib/R/site-library
packages:
brew, cpp11, crayon, evaluate, prettyunits, remotes, rprojroot, rstudioapi, withr
Warning message:
In install.packages(...) :
installation of package ‘RcppGSL’ had non-zero exit status
'''

I would appreciate any help

I dont want to update my R and Rstudio, because after that, all pakages are usually gone and I need to spend a lot of time to install them back.

Thank you
Best,
Alla

It looks very strange

I tried devtools

'''
devtools::install_github("cafferychen777/ggpicrust2")
Downloading GitHub repo cafferychen777/ggpicrust2@HEAD
Skipping 8 packages not available: SummarizedExperiment, metagenomeSeq, Maaslin2, limma, lefser, edgeR, DESeq2, ALDEx2
── R CMD build ──────────────────────────────────────────────────────────────────────────────────
:heavy_check_mark: checking for file ‘/tmp/RtmpjH2ycZ/remotes6e3b3815f522/cafferychen777-ggpicrust2-10b7d09/DESCRIPTION’ ...
─ preparing ‘ggpicrust2’:
:heavy_check_mark: checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
NB: this package now depends on R (>= 3.5.0)
WARNING: Added dependency on R >= 3.5.0 because serialized objects in
serialize/load version 3 cannot be read in older versions of R.
File(s) containing such objects:
‘ggpicrust2/data/daa_annotated_results_df.RData’
‘ggpicrust2/data/daa_results_df.RData’
‘ggpicrust2/data/kegg_abundance.RData’
‘ggpicrust2/data/ko_abundance.RData’
‘ggpicrust2/data/metacyc_abundance.RData’
‘ggpicrust2/data/metadata.RData’
‘ggpicrust2/inst/extdata/EC_reference.RData’
‘ggpicrust2/inst/extdata/KO_reference.RData’
‘ggpicrust2/inst/extdata/MetaCyc_reference.RData’
‘ggpicrust2/inst/extdata/kegg_reference.RData’
─ building ‘ggpicrust2_1.7.3.tar.gz’

Installing package into ‘/home/alla/R/x86_64-pc-linux-gnu-library/4.4’
(as ‘lib’ is unspecified)

  • installing source package ‘ggpicrust2’ ...
    ** using staged installation
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
    namespace ‘ggplot2’ 3.5.1 is being loaded, but == 3.4.2 is required
    Calls: ... withCallingHandlers -> loadNamespace -> namespaceImport -> loadNamespace
    Execution halted
    ERROR: lazy loading failed for package ‘ggpicrust2’
  • removing ‘/home/alla/R/x86_64-pc-linux-gnu-library/4.4/ggpicrust2’
    Warning message:
    In i.p(...) :
    installation of package ‘/tmp/RtmpjH2ycZ/file6e3b26547d9a/ggpicrust2_1.7.3.tar.gz’ had non-zero exit status
    '''

It say I have new version of ggplot2 and I need the older one...

Ok
I have tried next

'''
remove.packages("ggplot2")
Removing package from ‘/home/alla/R/x86_64-pc-linux-gnu-library/4.4’
(as ‘lib’ is unspecified)

library(remotes)
remotes::install_version("ggplot2", version = "3.4.2")
Downloading package from url: https://cloud.r-project.org/src/contrib/Archive/ggplot2/ggplot2_3.4.2.tar.gz
Installing package into ‘/home/alla/R/x86_64-pc-linux-gnu-library/4.4’
(as ‘lib’ is unspecified)

  • installing source package ‘ggplot2’ ...
    ** package ‘ggplot2’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error in .make_numeric_version(x, strict, .standard_regexps()$valid_numeric_version) :
    invalid non-character version specification 'x' (type: double)
    Error: unable to load R code in package ‘ggplot2’
    Execution halted
    ERROR: lazy loading failed for package ‘ggplot2’
  • removing ‘/home/alla/R/x86_64-pc-linux-gnu-library/4.4/ggplot2’
    Error in file(file, if (append) "a" else "w") :
    cannot open the connection
    In addition: Warning messages:
    1: In i.p(...) :
    installation of package ‘/tmp/RtmpjH2ycZ/remotes6e3b438a5cc/ggplot2’ had non-zero exit status
    2: In file(file, if (append) "a" else "w") :
    cannot open file '/usr/local/lib/R/site-library/ggplot2/DESCRIPTION': Permission denied
    '''

Please? I really need some help.

Best,
Alla

Ok
I did it
In case if anyone might have the same troubles

I used :

sudo R --vanilla

then I have installed in the terminal in vanilla session:

install.packages("ALDEx2")

After that

install.packages("ggpicrust2")

Now I have it

Best,
Alla

For the record, this should not be needed. You should be able to run R as a regular user. Possibly all you need is creating a package library for your user:

dir.create(Sys.getenv("R_LIBS_USER"), recursive = TRUE)

Thank you
I will try that)

Best,
Alla

This topic was automatically closed 7 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.