I tried to install the shiny related package RLumShiny on the server.
System Version: CentOS Linux release 8.1.1911 (Core)
I tried to use :
install.packages("RLumShiny")
Some errors were returned. But I can't find these errors now.
And then i tired to use :
wget https://cran.r-project.org/bin/macosx/contrib/4.1/RLumShiny_0.2.2.tgz
R CMD INSTALL RLumShiny_0.2.2.tgz
R
library("RLumShiny")
The server reported an error:
>library(RLumShiny)
Error: package or namespace load failed for ‘RLumShiny’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/shiny/R/x86_64-redhat-linux-gnu-library/4.1/terra/libs/terra.so':
/home/shiny/R/x86_64-redhat-linux-gnu-library/4.1/terra/libs/terra.so: invalid ELF header
Then i tried :
>install.packages("RLumShiny")
Installing package into ‘/home/shiny/R/x86_64-redhat-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
try open URL'https://mirror-hk.koddos.net/CRAN/src/contrib/RLumShiny_0.2.2.tar.gz'
Content type 'application/x-gzip' length 448539 bytes (438 KB)
==================================================
downloaded 438 KB
installing *source* package ‘RLumShiny’ ...
package ‘RLumShiny’ successfully unpacked and MD5 sums checked
using staged installation
R
inst
byte-compile and prepare package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/shiny/R/x86_64-redhat-linux-gnu-library/4.1/terra/libs/terra.so':
/home/shiny/R/x86_64-redhat-linux-gnu-library/4.1/terra/libs/terra.so: invalid ELF header
Calls: <Anonymous> ... namespaceImport -> loadNamespace -> library.dynam -> dyn.load
Execution halted
ERROR: lazy loading failed for package ‘RLumShiny’
* removing ‘/home/shiny/R/x86_64-redhat-linux-gnu-library/4.1/RLumShiny’
* restoring previous ‘/home/shiny/R/x86_64-redhat-linux-gnu-library/4.1/RLumShiny’
The downloaded source packages are in
‘/tmp/RtmpZxd0sL/downloaded_packages’
Warning message:
In install.packages("RLumShiny") :
installation of package ‘RLumShiny’ had non-zero exit status
How can this be fixed?
The problem is clearly with the terra package. So the way to fix it would be to (re-) install that package first; perhaps after installing its system requirements (see the repo) perhaps with
sudo dnf install gdal-devel proj-devel geos-devel sqlite-devel
Related
I cannot install the R packages tmaptools and tmap in ubuntu linux, I have followed the instructions in
https://geocompr.github.io/post/2020/installing-r-spatial-ubuntu/
I installed sf and checked:
library(sf)
Linking to GEOS 3.10.1, GDAL 3.4.0, PROJ 8.2.0; sf_use_s2() is TRUE
Warning messages:
1: replacing previous import ‘lifecycle::last_warnings’ by ‘rlang::last_warnings’ when loading ‘pillar’
2: replacing previous import ‘lifecycle::last_warnings’ by ‘rlang::last_warnings’ when loading ‘tibble’
When I try to instal tmaptools the following error appears
> install.packages("tmaptools")
Installing package into ‘/home/leonardo/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/tmaptools_3.1-1.tar.gz'
Content type 'application/x-gzip' length 40116 bytes (39 KB)
==================================================
downloaded 39 KB
* installing *source* package ‘tmaptools’ ...
** package ‘tmaptools’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** byte-compile and prepare package for lazy loading
Warning: replacing previous import ‘lifecycle::last_warnings’ by ‘rlang::last_warnings’ when loading ‘pillar’
Warning: replacing previous import ‘lifecycle::last_warnings’ by ‘rlang::last_warnings’ when loading ‘tibble’
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/leonardo/R/x86_64-pc-linux-gnu-library/4.1/lwgeom/libs/lwgeom.so':
libproj.so.19: cannot open shared object file: No such file or directory
Calls: <Anonymous> ... asNamespace -> loadNamespace -> library.dynam -> dyn.load
Execution halted
ERROR: lazy loading failed for package ‘tmaptools’
* removing ‘/home/leonardo/R/x86_64-pc-linux-gnu-library/4.1/tmaptools’
Warning in install.packages :
installation of package ‘tmaptools’ had non-zero exit status
I have already removed the package and installed it again, but I always get the same error.
Browsing the tmap issues on github I found the answer:
install lwgeom package, so
install.packages("lwgeom")
Solved the problem.
I recently upgrade ubuntu from 18.04 to 20.04, so this is probably related...
My code requires me to have the stringr package and to use tidyverse. When I try to run require(stringr) and library(tidyverse) I receive these errors,
> require(stringr) # String manipulation
Loading required package: stringr
Error: package or namespace load failed for ‘stringr’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/elrodlab/R/x86_64-pc-linux-gnu-library/3.6/stringi/libs/stringi.so':
libicui18n.so.60: cannot open shared object file: No such file or directory
> library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/home/elrodlab/R/x86_64-pc-linux-gnu-library/3.6/stringi/libs/stringi.so':
libicui18n.so.60: cannot open shared object file: No such file or directory
I've tried reinstalling stringr using install.packages("stringr") but then get
Installing package into ‘/home/elrodlab/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/stringr_1.4.0.tar.gz'
Content type 'application/x-gzip' length 135777 bytes (132 KB)
==================================================
downloaded 132 KB
* installing *source* package ‘stringr’ ...
** package ‘stringr’ successfully unpacked and MD5 sums checked
mv: cannot move '/home/elrodlab/R/x86_64-pc-linux-gnu-library/3.6/stringr' to '/home/elrodlab/R/x86_64-pc-linux-gnu-library/3.6/00LOCK-stringr/stringr': Permission denied
ERROR: cannot remove earlier installation, is it in use?
* removing ‘/home/elrodlab/R/x86_64-pc-linux-gnu-library/3.6/stringr’
Warning in install.packages :
installation of package ‘stringr’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmptRvgMm/downloaded_packages’
Although it seems as if Stringr is good to go and all there, when I attempt to use require(stringr) I end up getting this error
Loading required package: stringr Error: package or namespace load failed for ‘stringr’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/home/elrodlab/R/x86_64-pc-linux-gnu-library/3.6/stringi/libs/stringi.so': libicui18n.so.60: cannot open shared object file: No such file or directory
Any idea on how to handle this?
The second message seems to indicate that stringr was actually successfully installed. Try running again
require(stringr)
I am trying to install CRANs population genetics package hierfstat; however the following error with libproj.so.13 is printed:
> install.packages("hierfstat")
Installing package into ‘/home/ecoevo/R/x86_64-pc-linux-gnu-library/3.6’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/hierfstat_0.04-22.tar.gz'
Content type 'application/x-gzip' length 460778 bytes (449 KB)
==================================================
downloaded 449 KB
* installing *source* package ‘hierfstat’ ...
** package ‘hierfstat’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
** inst
** byte-compile and prepare package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/ecoevo/R/x86_64-pc-linux-gnu-library/3.6/sf/libs/sf.so':
libproj.so.13: cannot open shared object file: No such file or directory
Calls: <Anonymous> ... namespaceImport -> loadNamespace -> library.dynam -> dyn.load
Execution halted
ERROR: lazy loading failed for package ‘hierfstat’
* removing ‘/home/ecoevo/R/x86_64-pc-linux-gnu-library/3.6/hierfstat’
* restoring previous ‘/home/ecoevo/R/x86_64-pc-linux-gnu-library/3.6/hierfstat’
Warning in install.packages :
installation of package ‘hierfstat’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpXDoNEK/downloaded_packages’
Any suggestions on how to fix this error? I am working on Ubuntu-20.04
I was also facing same issue with ubuntu 20.04. In my case, I had extend my LD library path.
In bash
export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib
In tcsh
setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH\:/lib
setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH\:/usr/lib
setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH\:/usr/local/lib
Afterwards, you could already see that shared libraries can now be found if
/usr/local/bin/proj
does not result in any error.
I had the same issue with package "stars" while working on a shared computer. Other packages I was able to install, but not this one.
The issue was solved by running R as sudo.
From Terminal:
sudo R # start R session as sudo
install.packages("<package_name>") # install your package
q() # quit R session
I am getting the below error while trying to install the 'car' package in R. Is there anything wrong I am doing here?
trying URL 'https://cran.rstudio.com/src/contrib/car_3.0-2.tar.gz'
Content type 'application/x-gzip' length 447952 bytes (437 KB)
downloaded 437 KB
* installing source package 'car' ...
** package 'car' successfully unpacked and MD5 sums checked
** R
** inst
** byte-compile and prepare package for lazy loading
Warning: package 'carData' was built under R version 3.5.2
Warning in fun(libname, pkgname) :
bytecode version mismatch; using eval
Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object 'C:/Users/33904/Documents/R/win-library/3.3/data.table/libs/x64/datatable.dll':
LoadLibrary failure: The specified procedure could not be found.
ERROR: lazy loading failed for package 'car'
* removing 'C:/Users/33904/Documents/R/win-library/3.3/car'
* restoring previous 'C:/Users/33904/Documents/R/win-library/3.3/car'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.3/bin/x64/R" CMD INSTALL -l "C:\Users\33904\Documents\R\win-library\3.3" C:\Users\33904\AppData\Local\Temp\Rtmpm23nOy/downloaded_packages/car_3.0-2.tar.gz' had status 1
Warning in install.packages :
installation of package ‘car’ had non-zero exit status
It won't load the library.
setwd("C:/Users/***/Desktop")
install.packages('ROracle_1.2-1.zip', repos = NULL)
#Installing package into ‘C:/Users/***/Documents/R/win-library/3.3 (as ‘lib’ is unspecified)
#package ‘ROracle’ successfully unpacked and MD5 sums checked
library('ROracle')
#Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared object 'C:/Users/***/Documents/R/win-library/3.3/ROracle/libs/x64/ROracle.dll': LoadLibrary failure: The specified module could not be found.
I manually checked the file path and ROracle.dll is there.
EDIT:
I have RODBC and RJDBC working. I just don't understand why ROracle won't install:
library(ROracle)
Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object 'C:/Users/robsoo01/Documents/R/win-library/3.3/ROracle/libs/x64/ROracle.dll':
LoadLibrary failure: The specified module could not be found.
Error: package or namespace load failed for ‘ROracle’
install.packages("ROracle")
Installing package into ‘C:/Users/***/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘ROracle’
Do you want to attempt to install these from sources?
y/n: y
installing the source package ‘ROracle’
trying URL 'https://cran.rstudio.com/src/contrib/ROracle_1.2-2.tar.gz'
Content type 'application/x-gzip' length 304229 bytes (297 KB)
downloaded 297 KB
* installing *source* package 'ROracle' ...
** package 'ROracle' successfully unpacked and MD5 sums checked
ERROR: cannot find Oracle Client.
Please set OCI_LIB64 to specify its location.
Warning: running command 'sh ./configure.win' had status 1
ERROR: configuration failed for package 'ROracle'
* removing 'C:/Users/***/Documents/R/win-library/3.3/ROracle'
* restoring previous 'C:/Users/***/Documents/R/win-library/3.3/ROracle'
Warning in install.packages :
running command '"C:/PROGRA~1/R/R-33~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\***\Documents\R\win-library\3.3" C:\Users\***\AppData\Local\Temp\RtmpMvcLO4/downloaded_packages/ROracle_1.2-2.tar.gz' had status 1
Warning in install.packages :
installation of package ‘ROracle’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\***\AppData\Local\Temp\RtmpMvcLO4\downloaded_packages’
I'm guessing there are Oracle files that need installing, but none of the documentation is very clear.
In order for ROracle to install and load properly, you should have Oracle Client 64-bit and Windows 64-bit. Once I installed 64-bit Oracle Client on my machine, this error went away.