Fail to install R kernel for Jupyter in Mac - r

I use the following lines:
install.packages('devtools')
devtools::install_github('IRkernel/IRkernel')
but get warnings:
installing source package ‘IRkernel’ ...
Warning in as.POSIXlt.POSIXct(x, tz) :
unknown timezone 'default/America/Los_Angeles'
** R
** inst
** tests
** preparing package for lazy loading
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
Warning: running command '/usr/bin/otool -L /Library/Frameworks/R.framework/Versions/3.4/Resources/library/pbdZMQ/libs/pbdZMQ.so' had status 1
Error : .onLoad failed in loadNamespace() for 'pbdZMQ', details:
call: if (org != fn.libzmq.4.dylib) {
error: missing value where TRUE/FALSE needed
ERROR: lazy loading failed for package ‘IRkernel’
removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/IRkernel’
I try to solve this problem by
xcode-select --install
but get
Error: object 'xcode' not found

Late answer, but this just happened to me and I got the
Error: object 'xcode' not found
because I was still running R in Terminal. Make sure you quit R with
quit()
and then run
xcode-select --install
again (using Bash/Terminal, not R from within Terminal).

Related

RStudio: Problem installing tibble as dependency for Bchron

I've been trying to install Bchron for use with my dissertation data, and tibble is apparently one of the dependencies it needs. I'm fairly new to R so don't understand most of this, but I get pretty much the same error whether I try to install Bchron, tidyverse, or just tibble alone. Here's the error text (apologies if it's not conventionally formatted); any help would be appreciated:
Installing tibble [3.1.1] ...
FAILED
Error installing package 'tibble':
==================================
* installing to library ‘/Users/timdennehymac/Dropbox (Personal)/Dissertation/Chronology/Bchron3_TY/renv/staging/1’
* installing *source* package ‘tibble’ ...
** package ‘tibble’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
ERROR: compilation failed for package ‘tibble’
* removing ‘/Users/timdennehymac/Dropbox
(Personal)/Dissertation/Chronology/Bchron3_TY/renv/staging/1/tibble’
Error: install of package 'tibble' failed [error code 1]
In addition: Warning messages:
1: /usr/bin/xcrun --find --show-sdk-path returned exit code 1
2: In system2(R(), args, stdout = TRUE, stderr = TRUE) :
running command ''/Library/Frameworks/R.framework/Resources/bin/R' CMD config CC 2>&1' had status 1
3: In if (eval(cond, envir = environment(dot))) return(eval(expr, envir = environment(dot))) :
the condition has length > 1 and only the first element will be used
4: In if (eval(cond, envir = environment(dot))) return(eval(expr, envir = environment(dot))) :
the condition has length > 1 and only the first element will be used
The tibble package was updated yesterday to version 3.1.1.
There is not yet any binary available for this version, even on the Rstudio CRAN mirror so you will need to compile the package yourself.
Since you appear to be running MacOS, you will need to install the Xcode command line tools in order to be able to build packages.
Open terminal.app and type the following command:
xcode-select --install
Follow the on screen prompts.
Once the command line utilities have been installed. Close R, restart and try again.

Problem in installing 'RMongo' throws rJava error even though library(rJava) works fine

install.packages("RMongo")
doesn't works (seems like it has been deprecated.
So, I was trying to install using devtools.
devtools::install_github("tc/Rmongo")
but it gives out error
Error: package or namespace load failed for 'rJava':
.onLoad failed in loadNamespace() for 'rJava', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/saini/OneDrive/Documents/R/win-library/3.5/rJava/libs/i386/rJava.dll':
LoadLibrary failure: %1 is not a valid Win32 application.
Error : package 'rJava' could not be loaded
Error: loading failed
Execution halted
*** arch - x64
Warning: package 'rJava' was built under R version 3.5.2
ERROR: loading failed for 'i386'
* removing 'C:/Users/saini/OneDrive/Documents/R/win-library/3.5/RMongo'
In R CMD INSTALL
Error in i.p(...) :
(converted from warning) installation of package ‘C:/Users/saini/AppData/Local/Temp/RtmpuEHfqO/file20f419985c01/RMongo_0.1.0.tar.gz’ had non-zero exit status
Even though library(rJava) works fine.
JDK, JRE are both 64 bit. R and R studio are also 64 bits.
Someone suggested to use
R CMD javareconf
but it doesnot recongnises javareconf.
Also, I've set Environment Variables.

Error : .onLoad failed in loadNamespace() for 'RSPerl', details:

I have been trying to install the package RSPerl with the command where I have R 2.15.3 and Perl 5.10 :
PERL=`which perl` R --vanilla CMD INSTALL -c -l ~/library/ RSPerl_0.92-1.tar.gz
I am getting this error:
Warning: /tmp/RtmpQZ3PRs/R.INSTALL146277fe434b/RSPerl/man/PerlReferenceObjects.Rd:32: unknown macro '\textit'
*** installing help indices
** building package indices
Removing additional files
** testing if installed package can be loaded
Error : .onLoad failed in loadNamespace() for 'RSPerl', details:
call: setPerlLib(FALSE)
error: could not find function "Sys.putenv"
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/AVT2130/software/R-2.15.3/library/RSPerl
Please help to solve this problem.
Thank you,

loading failed error when install R package from github

I am working on Bayesian inference and I want to install bayesVAR_TVP package from Github. I tried the following commands:
install.packages("devtools")
library(devtools)
install_github("GediminasB/bayesVAR_TVP")
and
install.packages("githubinstall")
gh_install_packages("bayesVAR_TVP")
In both case I received the following error:
Error: package or namespace load failed for 'bayesVARTVP' in library.dynam(lib, package, package.lib):
DLL 'bayesVAR' not found: maybe not installed for this architecture?
Error: loading failed
Execution halted
*** arch - x64
Error: package or namespace load failed for 'bayesVARTVP' in library.dynam(lib, package, package.lib):
DLL 'bayesVAR' not found: maybe not installed for this architecture?
Error: loading failed
Execution halted
ERROR: loading failed for 'i386', 'x64'
* removing 'C:/Users/Hamed/Documents/R/win-library/3.4/bayesVARTVP'
In R CMD INSTALL
Installation failed: Command failed (1)
I have checked some similar questions on this site but they could not help me. I am working on a Win 7 64b and R 3.4.3. Also, my friend has a similar error on mac system. Does anyone have any idea? Thanks beforehand.

Cannot install rgdal package in R on RHEL6, unable to load shared object rgdal.so

I have AWS RHEL6 server where I've installed (compiled) rgdal 1.9.2 and proj packages. Now in R I want to install rgdal package but it gives this error:
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/Roel/R/x86_64-redhat-linux-gnu-library/3.3/rgdal/libs/rgdal.so':
libgdal.so.1: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/Roel/R/x86_64-redhat-linux-gnu-library/3.3/rgdal’
Warning in install.packages :
installation of package ‘rgdal’ had non-zero exit status
Full install log can be found here.
When I do locate rgdal.so in Linux it doesn't find anything. I can also not find how to get rgdal.so of what it is part of.
Has anyone any idea on how to fix this?
I fixed it:
There is an error further up in the log as well that I had missed because of the error at the end:
./proj_conf_test: error while loading shared libraries: libgdal.so.1: cannot open shared object file: No such file or directory
libgdal.so.1 was on the system in /usr/local/lib.
I then did:
echo "/usr/local/lib" >> /etc/ld.so.conf.d/R-dependencies-x86_64.conf
ldconfig
This fixed the subsequent error that I mentioned in the OP.
If you see Permission Denied when running Roel's, try:
sudo ldconfig -c "echo '/usr/local/lib' >> /etc/ld.so.conf.d/R-dependencies-x86_64.conf"

Resources