REditorSupport / languageserver

An implementation of the Language Server Protocol for R
Other
581 stars 93 forks source link

Installation Error: "Error: package ‘R.methodsS3’ required by ‘R.oo’ could not be found" #561

Closed wjs20 closed 2 years ago

wjs20 commented 2 years ago

I keep getting a weird error when I try to install the language server. It seems to get stuck looking for a 'R.methodsS3' package, which means it can't install R.oo, which is relied upon by a bunch of other dependecies so it ends up just crashing out.

My code.

sudo apt install --assume-yes --no-install-recommends build-essential libcurl4-openssl-dev libssl-dev libxml2-dev r-base
install.packages('languageserver')

The main error.

Error: package ‘R.methodsS3’ required by ‘R.oo’ could not be found                                                                                                                        1 Execution halted
    2 Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
    3   there is no package called ‘rprojroot’
    4 Calls: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
    5 Execution halted

The rest of the installation output.

Installing package into ‘/home/ws/data/Rpackages’
(as ‘lib’ is unspecified)
also installing the dependencies ‘R.oo’, ‘R.utils’, ‘cyclocomp’, ‘desc’, ‘pkgload’, ‘R.cache’, ‘lintr’, ‘roxygen2’, ‘styler’

trying URL 'https://cloud.r-project.org/src/contrib/R.oo_1.25.0.tar.gz'
Content type 'application/x-gzip' length 384384 bytes (375 KB)
==================================================
downloaded 375 KB

trying URL 'https://cloud.r-project.org/src/contrib/R.utils_2.12.0.tar.gz'
Content type 'application/x-gzip' length 363986 bytes (355 KB)
==================================================
downloaded 355 KB

trying URL 'https://cloud.r-project.org/src/contrib/cyclocomp_1.1.0.tar.gz'
Content type 'application/x-gzip' length 8407 bytes
==================================================
downloaded 8407 bytes

trying URL 'https://cloud.r-project.org/src/contrib/desc_1.4.1.tar.gz'
Content type 'application/x-gzip' length 80670 bytes (78 KB)
==================================================
downloaded 78 KB

trying URL 'https://cloud.r-project.org/src/contrib/pkgload_1.3.0.tar.gz'
Content type 'application/x-gzip' length 76008 bytes (74 KB)
==================================================
downloaded 74 KB

trying URL 'https://cloud.r-project.org/src/contrib/R.cache_0.15.0.tar.gz'
Content type 'application/x-gzip' length 34692 bytes (33 KB)
==================================================
downloaded 33 KB

trying URL 'https://cloud.r-project.org/src/contrib/lintr_3.0.0.tar.gz'
Content type 'application/x-gzip' length 2191085 bytes (2.1 MB)
==================================================
downloaded 2.1 MB

trying URL 'https://cloud.r-project.org/src/contrib/roxygen2_7.2.0.tar.gz'
Content type 'application/x-gzip' length 277678 bytes (271 KB)
==================================================
downloaded 271 KB

trying URL 'https://cloud.r-project.org/src/contrib/styler_1.7.0.tar.gz'
Content type 'application/x-gzip' length 323610 bytes (316 KB)
==================================================
downloaded 316 KB

trying URL 'https://cloud.r-project.org/src/contrib/languageserver_0.3.13.tar.gz'
Content type 'application/x-gzip' length 80312 bytes (78 KB)
==================================================
downloaded 78 KB

* installing *source* package ‘R.oo’ ...
** package ‘R.oo’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
ERROR: lazy loading failed for package ‘R.oo’
* removing ‘/home/ws/data/Rpackages/R.oo’
* installing *source* package ‘desc’ ...
** package ‘desc’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
ERROR: lazy loading failed for package ‘desc’
* removing ‘/home/ws/data/Rpackages/desc’
ERROR: dependency ‘R.oo’ is not available for package ‘R.utils’
* removing ‘/home/ws/data/Rpackages/R.utils’
ERROR: dependency ‘desc’ is not available for package ‘cyclocomp’
* removing ‘/home/ws/data/Rpackages/cyclocomp’
ERROR: dependency ‘desc’ is not available for package ‘pkgload’
* removing ‘/home/ws/data/Rpackages/pkgload’
ERROR: dependencies ‘R.oo’, ‘R.utils’ are not available for package ‘R.cache’
* removing ‘/home/ws/data/Rpackages/R.cache’
ERROR: dependency ‘cyclocomp’ is not available for package ‘lintr’
* removing ‘/home/ws/data/Rpackages/lintr’
ERROR: dependencies ‘desc’, ‘pkgload’ are not available for package ‘roxygen2’
* removing ‘/home/ws/data/Rpackages/roxygen2’

ERROR: dependency ‘R.cache’ is not available for package ‘styler’
* removing ‘/home/ws/data/Rpackages/styler’
ERROR: dependencies ‘lintr’, ‘roxygen2’, ‘styler’ are not available for package ‘languageserver’
* removing ‘/home/ws/data/Rpackages/languageserver’

The downloaded source packages are in
        ‘/tmp/RtmpGK31aA/downloaded_packages’
Warning messages:
1: In install.packages("languageserver") :
  installation of package ‘R.oo’ had non-zero exit status
2: In install.packages("languageserver") :
  installation of package ‘desc’ had non-zero exit status
3: In install.packages("languageserver") :
  installation of package ‘R.utils’ had non-zero exit status
4: In install.packages("languageserver") :
  installation of package ‘cyclocomp’ had non-zero exit status
5: In install.packages("languageserver") :
  installation of package ‘pkgload’ had non-zero exit status
6: In install.packages("languageserver") :
  installation of package ‘R.cache’ had non-zero exit status
7: In install.packages("languageserver") :
  installation of package ‘lintr’ had non-zero exit status
8: In install.packages("languageserver") :
  installation of package ‘roxygen2’ had non-zero exit status
9: In install.packages("languageserver") :
  installation of package ‘styler’ had non-zero exit status
10: In install.packages("languageserver") :
  installation of package ‘languageserver’ had non-zero exit status

output from sessionInfo below

> sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.4 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_4.2.1 tools_4.2.1
randy3k commented 2 years ago

Looks like you have an issue installing R.oo, which is one of our dependencies. Not sure what was causing it though.

wjs20 commented 2 years ago

Yes it does seem to be the R.oo package.

When I look through the traceback, it says the R.oo package could not be installed because the R.methodsS3 package could not be found.

I installed the R.methodsS3 package into my local package directory user/home/data/Rpackages/ (which is added in my .Reviron file) and retried the R.oo install on its own, but it still says it could not be installed because the R.methodsS3 package could not be found.

I don't understand why it is not including R.methodsS3 in the dependency install process, or why it is not finding it once it has been manually installed. Do you have any idea?

Thanks for your help!

wjs20 commented 2 years ago

I re-ran install.packages('languageserver') again and it seemed to fix the issue... not sure why.