stefan-m-lenz / JuliaConnectoR

A functionally oriented interface for calling Julia from R
Other
102 stars 6 forks source link

[BUG] DataFrames Failing to Load #18

Closed TheCedarPrince closed 2 years ago

TheCedarPrince commented 2 years ago

DataFrames seems to not be working on my RHEL 8 machine running Julia 1.7.3:

library(JuliaConnectoR)

pkg <- juliaImport("Pkg")
pkg$activate("TUTORIAL", shared = TRUE) 
pkg$add("DataFrames")
juliaImport("DataFrames")

Which results in this failure:

WARNING: could not import DataAPI.metadata into DataFrames
WARNING: could not import DataAPI.metadatakeys into DataFrames
WARNING: could not import DataAPI.metadata! into DataFrames
WARNING: could not import DataAPI.deletemetadata! into DataFrames
WARNING: could not import DataAPI.emptymetadata! into DataFrames
WARNING: could not import DataAPI.colmetadata into DataFrames
WARNING: could not import DataAPI.colmetadatakeys into DataFrames
WARNING: could not import DataAPI.colmetadata! into DataFrames
WARNING: could not import DataAPI.deletecolmetadata! into DataFrames
WARNING: could not import DataAPI.emptycolmetadata! into DataFrames
ERROR: LoadError: UndefVarError: metadatasupport not defined
Stacktrace:
  [1] getproperty(x::Module, f::Symbol)
    @ Base ./Base.jl:35
  [2] top-level scope
    @ ~/.julia/packages/DataFrames/Lrd7K/src/other/metadata.jl:8
  [3] include(mod::Module, _path::String)
    @ Base ./Base.jl:418
  [4] include(x::String)
    @ DataFrames ~/.julia/packages/DataFrames/Lrd7K/src/DataFrames.jl:1
  [5] top-level scope
    @ ~/.julia/packages/DataFrames/Lrd7K/src/DataFrames.jl:172
  [6] include
    @ ./Base.jl:418 [inlined]
  [7] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{St
ring}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{
Pair{Base.PkgId, UInt64}}, source::String)
    @ Base ./loading.jl:1318
  [8] top-level scope
    @ none:1
  [9] eval
    @ ./boot.jl:373 [inlined]
 [10] eval(x::Expr)
    @ Base.MainInclude ./client.jl:453
 [11] top-level scope
    @ none:1
in expression starting at /home/[REDACTED]/.julia/packages/DataFrames/Lrd7K/
src/other/metadata.jl:8
in expression starting at /home/[REDACTED]/.julia/packages/DataFrames/Lrd7K/
src/DataFrames.jl:1
Error: Evaluation in Julia failed.
Original Julia error message:
LoadError: Failed to precompile DataFrames [a93c6f00-e57d-5684-b7b6-d8193f3e46c0] to /
home/[REDACTED]/.julia/compiled/v1.7/DataFrames/jl_9mFYjo.
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:33
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout
::IO, ignore_loaded_modules::Bool)
    @ Base ./loading.jl:1466
  [3] compilecache(pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1410
  [4] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1120
  [5] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1013
  [6] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:997
  [7] eval
    @ ./boot.jl:373 [inlined]
  [8] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::S
tring)
    @ Base ./loading.jl:1196
  [9] include_string (repeats 2 times)
    @ ./loading.jl:1206 [inlined]
 [10] mainevalcmd(str::String)
    @ Main.RConnector ~/.rlibr

This does not happen on my Fedora 34 machine running Julia 1.8. Any idea as to what is happening?

Either way, really love this package @stefan-m-lenz -- thanks for the great work here!

stefan-m-lenz commented 2 years ago

Thanks, can it be that you have an older version of DataFrames in the older Julia version and that your TUTORIAL uses features that are not present in the older version? Does this error appear without the JuliaConnectoR as well?

TheCedarPrince commented 2 years ago

Hey @stefan-m-lenz , I checked what you were asking and everything on my side is up to date. I am using R v4.1.3 and DataFrames 1.4.1. The error does not occur within DataFrames by itself and I can confirm this error also does not occur on Windows machines. Not sure what is going on.

TheCedarPrince commented 2 years ago

Hey @stefan-m-lenz , feel free to close this issue! Oddly, when I updated to version 1.8.2 this issue no longer exists. Not sure what happened there on my side!

stefan-m-lenz commented 2 years ago

One thing that comes to my mind, which could be related to this issue is the fact that the JuliaConnectoR loads the Tables.jlpackage when it starts. It could result in issues if the version of Tables is not compatible with the version that you are using in your MANIFEST because this could result in other packages being downgraded. In that case, reinstalling Tables with a suitable version and restarting the JuliaConnectoR should fix the issue. It is hard to find the cause of the problem in this case. I will close the issue now. Feel free to reopen if you have more information that could help to pinpoint the problem.