8

I'm installing XLConnect library in R studio but, unable to do so.

I know that this package has java dependency and my R software and java both are 64 bit. Also, both have configured correctly. I have also installed rJava package before installing XLConnect. This package was working properly but, now I'm getting this error.

library(XLConnect)

ERROR: package or namespace load failed for'XLconnect':
.onload failed in loadNamespace() for XLConnect, details:
Call. System2("cat",c("/etc/*-release"), stdout =TRUE, stderr = TRUE) error: ' "cat" not found.

Please help me.

Rui Barradas
  • 70,273
  • 8
  • 34
  • 66
Rishabh
  • 101
  • 1
  • 4
  • What OS are you running? If it's Windows, ``cat`` is not a traditional command. – NomadMaker Apr 14 '21 at 07:41
  • It's windows OS. – Rishabh Apr 14 '21 at 08:08
  • Commit from 2/11 seems to have introduced it - function checkSystemPackage calls for cat without checking OS : https://github.com/miraisolutions/xlconnect/commit/95158798b0448b85730a21887009bc74c9fde9fb#diff-d0d5814b3195067bc3d51b62f652305287ae84721ec230ce930dacd3ccb275f8. Best solution is probably to install an old version. – Bryce Chamberlain Apr 14 '21 at 18:18
  • To clarify the comment from @NomadMaker , `system2` submits system commands, and `cat` is not a command in Windows. Hence the error, which you would receive if you entered `cat` on the command line. – Joe Wasserman Apr 22 '21 at 14:16
  • If unix commands are needed and you are using Windows, install Rtools. – Rui Barradas May 28 '21 at 19:31

5 Answers5

4

This worked for me: install prior version until they fix this at CRAN:

require(devtools)
install_version("XLConnect", version = "1.0.2", repos = "http://cran.us.r-project.org")

https://github.com/miraisolutions/xlconnect/issues/132 also recommends:

install.packages("XLConnect", type="source", INSTALL_opts = c("--no-multiarch"))
1

If still relevant, adding rtools to "path" (system environment variable) worked for me.

Duncan Howe
  • 2,965
  • 19
  • 18
  • yeah - that was the issue for me - I installed `gdata` - or tried to - and there was an issue with `Perl`. Therefore, I had to switch the order in `.Renviron`, following https://stackoverflow.com/questions/63411363/how-to-fix-perl-warning-message-when-loading-gdata-package and though it fixed the `gdata` issue, I had to revert to not face the issue above! Might help someone else if you ever hit these (annoying) issues.... – tchevrier Jul 07 '21 at 14:39
0

XLConnect is still required to read xlsx-files that were created with SAP's business intelligence tool. These Excel files appear empty for readxl and openxlsx.

0

Along with the above solutions, I had to use this line of code to make it work properly.

sys.setenv(XLCONNECT_JAVA_Repo_URL='https://jcenter.bintray.com')
Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
Rishabh
  • 101
  • 1
  • 4
0

I have been new to R, and faced this challenge. After incorporating all the above recommendations, this is what worked for me (Windows user):

  1. install.packages("devtools")

  2. install_version("XLConnect", version = "1.0.1", repos = "http://cran.us.r-project.org")

  3. After you load JGR library (if that's your preferred GUI), then you can check the default option of XLconnect under package manager.

Thanks for your contribution.