issues with downloading phyloseq (R 4.3.1) MacOS

Hello, I am having significant issues installing the package phyloseq on R 4.3.1

I have tried installing using the following code:

if(!requireNamespace("BiocManager")){
+     install.packages("BiocManager")
+ }
> BiocManager::install("phyloseq")

and the result I am getting is as follows:

'getOption("repos")' replaces Bioconductor standard repositories, see
'help("repositories", package = "BiocManager")' for details.
Replacement repositories:
    CRAN: https://cran.rstudio.com/
Bioconductor version 3.17 (BiocManager 1.30.22), R 4.3.1 (2023-06-16)
Installing package(s) 'phyloseq'
installing the source package ‘phyloseq’

trying URL 'https://bioconductor.org/packages/3.17/bioc/src/contrib/phyloseq_1.44.0.tar.gz'
Content type 'application/x-gzip' length 5689663 bytes (5.4 MB)
==================================================
downloaded 5.4 MB

* installing *source* package ‘phyloseq’ ...
** using staged installation
** R
** data
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  there is no package called ‘Rhdf5lib’
Calls: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
ERROR: lazy loading failed for package ‘phyloseq’
* removing ‘/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library/phyloseq’

The downloaded source packages are in
	‘/private/var/folders/3m/9jvg77md2rg1k_jd94l23cdw0000gn/T/RtmpxO0fyx/downloaded_packages’
Old packages: 'credentials', 'deSolve', 'foreign', 'ggeffects', 'Hmisc', 'insight',
  'knitr', 'minqa', 'performance', 'RcppArmadillo'
Update all/some/none? [a/s/n]: 
a
trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.3/credentials_1.3.2.tgz'
Content type 'application/x-gzip' length 170632 bytes (166 KB)
==================================================
downloaded 166 KB

trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.3/deSolve_1.37.tgz'
Content type 'application/x-gzip' length 2629393 bytes (2.5 MB)
==================================================
downloaded 2.5 MB

trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.3/foreign_0.8-84.tgz'
Content type 'application/x-gzip' length 341244 bytes (333 KB)
==================================================
downloaded 333 KB

trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.3/ggeffects_1.3.0.tgz'
Content type 'application/x-gzip' length 634011 bytes (619 KB)
==================================================
downloaded 619 KB

trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.3/Hmisc_5.1-0.tgz'
Content type 'application/x-gzip' length 3515255 bytes (3.4 MB)
==================================================
downloaded 3.4 MB

trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.3/insight_0.19.3.tgz'
Content type 'application/x-gzip' length 2092645 bytes (2.0 MB)
==================================================
downloaded 2.0 MB

trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.3/knitr_1.43.tgz'
Content type 'application/x-gzip' length 1464612 bytes (1.4 MB)
==================================================
downloaded 1.4 MB

trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.3/minqa_1.2.5.tgz'
Content type 'application/x-gzip' length 338630 bytes (330 KB)
==================================================
downloaded 330 KB

trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.3/performance_0.10.4.tgz'
Content type 'application/x-gzip' length 3037026 bytes (2.9 MB)
==================================================
downloaded 2.9 MB

trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.3/RcppArmadillo_0.12.6.3.0.tgz'
Content type 'application/x-gzip' length 1666966 bytes (1.6 MB)
==================================================
downloaded 1.6 MB


The downloaded binary packages are in
	/var/folders/3m/9jvg77md2rg1k_jd94l23cdw0000gn/T//RtmpxO0fyx/downloaded_packages
Warning message:
In install.packages(...) :
  installation of package ‘phyloseq’ had non-zero exit status

I followed this help tutorial as it best suits my specific error, yet when I get to the step to write in the terminal: which gfortran

I get the following output: gfortran not found

I have downloaded and installed the latest version of java, and I am at a loss. Please advise on how to proceed.

This issue was solved with running the following lines before installing phyloseq:

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

BiocManager::install("Rhdf5lib")

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