Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation stuck at step "testing if installed package can be loaded from temporary location" #36

Open
QuinceyLv opened this issue Oct 12, 2023 · 2 comments

Comments

@QuinceyLv
Copy link

Hi,
I tried to install RBioFormats on R4.3.0:

BiocManager::install("aoles/RBioFormats")

── R CMD build ─────────────────────────────────────────────────────────────────

  • checking for file ‘/tmp/9771460.1.SC1.q/RtmptHlfNa/remotes5b886ec82ce9/aoles-RBioFormats-5ec5fad/DESCRIPTION’ ... OK

  • preparing ‘RBioFormats’:

  • checking DESCRIPTION meta-information ... OK

  • checking for LF line-endings in source and make files and shell scripts

  • checking for empty or unneeded directories

  • building ‘RBioFormats_0.99.14.tar.gz’

  • installing source package ‘RBioFormats’ ...
    ** using staged installation
    ** 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

and the installation stuck at this step. How could I solve this? Thanks in advance.

@lambdamoses
Copy link

It seems that it's trying to download Bio-Formats at this stage, which can take a while depending on your internet, and I got

Warning in utils::download.file(bf_url, bf_jar, mode = "wb", quiet = FALSE) :
  downloaded length 0 != reported length 0
Warning in utils::download.file(bf_url, bf_jar, mode = "wb", quiet = FALSE) :
  URL 'https://downloads.openmicroscopy.org/bio-formats/6.12.0/artifacts/bioformats_package.jar': Timeout of 100 seconds was reached
Error: package or namespace load failed for ‘RBioFormats’:
 .onLoad failed in loadNamespace() for 'RBioFormats', details:
  call: NULL
  error: Failed to download Bio-Formats Java library.
  Check your internet connection and try again. Consider setting the environment variable R_DEFAULT_INTERNET_TIMEOUT to a value higher than 100.
Error: loading failed
Execution halted

Setting Sys.setenv(R_DEFAULT_INTERNET_TIMEOUT = 2000) solved the problem for me. Maybe use a larger value if your internet is slower.

@QuinceyLv
Copy link
Author

It seems that it's trying to download Bio-Formats at this stage, which can take a while depending on your internet, and I got

Warning in utils::download.file(bf_url, bf_jar, mode = "wb", quiet = FALSE) :
  downloaded length 0 != reported length 0
Warning in utils::download.file(bf_url, bf_jar, mode = "wb", quiet = FALSE) :
  URL 'https://downloads.openmicroscopy.org/bio-formats/6.12.0/artifacts/bioformats_package.jar': Timeout of 100 seconds was reached
Error: package or namespace load failed for ‘RBioFormats’:
 .onLoad failed in loadNamespace() for 'RBioFormats', details:
  call: NULL
  error: Failed to download Bio-Formats Java library.
  Check your internet connection and try again. Consider setting the environment variable R_DEFAULT_INTERNET_TIMEOUT to a value higher than 100.
Error: loading failed
Execution halted

Setting Sys.setenv(R_DEFAULT_INTERNET_TIMEOUT = 2000) solved the problem for me. Maybe use a larger value if your internet is slower.

Thanks for reply. I had checked zzz.R and found:

if ( !file.exists(bf_jar) ) {
    # The default for timing out the file download is 60s
    # Temporarily increase it if this is the case
    orig_timeout <- getOption("timeout")
    options(timeout = max(100, orig_timeout))
    tryCatch(utils::download.file(bf_url, bf_jar, mode = "wb", quiet = FALSE),
             error = function(e) {
               file.remove(bf_jar)
               stop(
                 "Failed to download Bio-Formats Java library.\n  Check your internet connection and try again. Consider setting the environment variable R_DEFAULT_INTERNET_TIMEOUT to a value higher than 100.",
                 call.=FALSE)
             },
    finally=options(timeout = orig_timeout)
    )
  }
}

I tried to change the timeout or to download the jar package manually and change the "download.file" to "file.copy" from local, but either worked. Maybe Sys.setenv(R_DEFAULT_INTERNET_TIMEOUT = 2000) could save me...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants