Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package 'stats' in options("defaultPackages") was not found #544

Closed
eohne opened this issue Aug 20, 2024 · 2 comments
Closed

package 'stats' in options("defaultPackages") was not found #544

eohne opened this issue Aug 20, 2024 · 2 comments

Comments

@eohne
Copy link

eohne commented Aug 20, 2024

Hi I am having trouble getting RCall to work.

It used to be fine until I decided to update R to version 4.4.1.

I have R as well as Rtools44 and R studio installed. RStudio works fine so does R on its own. I am installing all of this on a Windows 11 computer.

Interestingly RCall can find all standard library packages except stats.dll. The file exists I have checked and Julia/R can see it.
Here is what I did and the output:

julia> versioninfo()
Julia Version 1.9.1
Commit 147bdf428c (2023-06-07 08:27 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 16 × AMD Ryzen 7 5700X3D 8-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, znver3)
  Threads: 8 on 16 virtual cores
Environment:
  JULIA_NUM_THREADS = 8

julia> ENV["RTOOLS44_HOME"] = raw"C:\rtools44\usr\bin"
"C:\\rtools44\\usr\\bin"

julia> ENV["R_HOME"] = raw"C:\Program Files\R\R-4.4.1"
"C:\\Program Files\\R\\R-4.4.1"

(@v1.9) pkg> build RCall
    Building Conda  `C:\Users\XXX\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\b19db3927f0db4151cb86d073689f2428e524576\build.log`
    Building RCall  `C:\Users\XXX\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\0108d620933b25dbfde2e5ed492fce9aee767d95\build.log`

julia> using RCall
┌ Warning: RCall.jl: During startup - Warning message:
│ package 'stats' in options("defaultPackages") was not found
└ @ RCall C:\Users\XXX\.julia\packages\RCall\FEbLj\src\io.jl:172

julia> RCall.Rhome
"C:\\Program Files\\R\\R-4.4.1"

julia> ENV["R_HOME"]
"C:/Program Files/R/R-4.4.1"

R> version
               _
platform       x86_64-w64-mingw32
arch           x86_64
os             mingw32
crt            ucrt
system         x86_64, mingw32
status
major          4
minor          4.1
year           2024
month          06
day            14
svn rev        86737
language       R
version.string R version 4.4.1 (2024-06-14 ucrt)
nickname       Race for Your Life

Things that I have tried that seem to solve the issue for some people:

  • add C:\Program Files\R\R-4.4.1\bin to path
  • also add C:\Program Files\R\R-4.4.1\bin\x64 to path
  • add rtools to path
  • uninstalling and reinstalling all R related things (R, RStudio, RTools)
  • tried different R versions (4.4.0, 4.3.3 and 4.3.0)
  • rtools uninstalled (even though I need it to build some R packages).
  • Removed and added RCall
  • RCall v0.14.4
  • RCall v0.14.3

None of these things seem to help.

Would be happy about any pointers, suggestions, solutions etc.
Thanks in advance!

Edit: Added a couple more things I have tried (been at this for hours so likely tried more things than mentioned)

Edit 2: Just saw that there is a log file created when building RCall. This was in it: [ Info: Using R at C:\Program Files\R\R-4.4.1 and libR at C:\Program Files\R\R-4.4.1\bin\x64\R.dll. which i guess looks fine?

@eohne
Copy link
Author

eohne commented Aug 20, 2024

Some how a conda R version was installed at some point in the .julia/conda folder. After getting rid of that everything seems to work fine.
Can be closed but maybe still worth looking into as the behaviour is still weird.

@palday
Copy link
Collaborator

palday commented Aug 20, 2024

Something wonky seems to happen, especially on Windows systems, when R is upgraded "behind RCall's back". I don't know what it exactly causes it but it can grab DLLs from two different R versions. You did everything I know to do.

@palday palday closed this as completed Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants