Code Monkey home page Code Monkey logo

Comments (2)

lambdamoses avatar lambdamoses commented on August 15, 2024 1

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.

from rbioformats.

QuinceyLv avatar QuinceyLv commented on August 15, 2024

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...?

from rbioformats.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.