none
Error installing jsonlite. "Error in loadNamespace” RRS feed

  • Question

  • I am trying to install jsonlite package for R and it's failing with this error:

    install.packages("jsonlite")

    Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : there is no package called ‘jsonlite’ Calls: ... tryCatch -> tryCatchList -> tryCatchOne -> Execution halted

    I understand jsonlite is preinstalled as part of MRO but somehow it got removed.

    For that matter, any package I try to install fails with this message. For an example, if I try to install devtools using install.packages("devtools", repos = "https://cloud.r-project.org/") it fails with the following:

    Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
    there is no package called ‘jsonlite’
    Calls: ... tryCatch -> tryCatchList -> tryCatchOne ->
    Execution halted
    The downloaded source packages are in
    ‘/tmp/RtmpbkyMoe/downloaded_packages’
    Updating HTML index of packages in '.Library'
    Making 'packages.html' ... done
    There were 12 warnings (use warnings() to see them)

    Revo.version:

    version.string Microsoft R Server version 9.1.1.0024 (2017-05-23 18:47:22 UTC)>

    SessionInfo()
    R version 3.3.3 (2017-03-06)
    Platform: x86_64-pc-linux-gnu (64-bit)
    Running under: Ubuntu 16.04.4 LTS
    
    locale:
     [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
     [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
     [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
    
    attached base packages:
    [1] stats     graphics  grDevices utils     datasets  methods   base     
    
    other attached packages:
    [1] RevoUtils_10.0.3     RevoMods_11.0.0      lattice_0.20-34      rpart_4.1-10         RevoUtilsMath_10.0.0
    
    loaded via a namespace (and not attached):
     [1] Rcpp_0.12.16     rstudioapi_0.7   magrittr_1.5     bindr_0.1        xtable_1.8-2     R6_2.2.2         rlang_0.2.0.9000
     [8] foreach_1.4.3    httr_1.3.1       tools_3.3.3      grid_3.3.3       DBI_0.8          htmltools_0.3.5  iterators_1.0.8 
    [15] assertthat_0.2.0 digest_0.6.15    rprojroot_1.3-2  tibble_1.4.2     bindrcpp_0.2     shiny_1.0.3      base64enc_0.1-3 
    [22] codetools_0.2-15 glue_1.2.0       mime_0.5         pillar_1.2.1     backports_1.0.5  httpuv_1.3.3     pkgconfig_2.0.0 

    Any pointers will be appreciated.




    Monday, March 19, 2018 1:33 PM

All replies

  • This most likely is a R library pathing issue. You may unknowingly have 2 library paths defined and the default one is a user specific library. You can check this via the '.libPaths()' function in R. 

    You can reset it with that function too:

    .libPaths("C:\Program Files\Microsoft\R Open\R_SERVER\library")

    Then try reinstalling the 'devtools' package - if you have the correct library set, it should work.

    Wednesday, March 21, 2018 7:25 PM