Error: package or namespace load failed for XLConnect
Asked Answered
I

5

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.

Ibbie answered 14/4, 2021 at 7:30 Comment(5)
What OS are you running? If it's Windows, cat is not a traditional command.Pellerin
It's windows OS.Ibbie
Commit from 2/11 seems to have introduced it - function checkSystemPackage calls for cat without checking OS : github.com/miraisolutions/xlconnect/commit/…. Best solution is probably to install an old version.Russom
To clarify the comment from @Pellerin , 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.Sportive
If unix commands are needed and you are using Windows, install Rtools.Symbolize
R
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"))
Russom answered 14/4, 2021 at 18:26 Comment(1)
None of the above worked but installing version = "1.0.1" did.Fourier
V
2

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

Vain answered 2/6, 2021 at 12:14 Comment(1)
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 #63411863 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....Farber
C
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.

Coplin answered 28/5, 2021 at 9:43 Comment(0)
I
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')
Ibbie answered 31/5, 2021 at 10:12 Comment(0)
B
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.

Bename answered 17/6, 2021 at 5:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.