I have created a R model using Readxl and haven package and have pickled the model using saveRDS function. Now when i try to load the model using readRDS the package import for readxl and haven packages fail
i am using importr and trying to load the readxl package
To Reproduce
packages=[]
packages.append({"name": "readxl", "version": "1.3.1"})
p_list = [package["name"] for package in packages]
import rpy2.robjects.packages as rpackages
for package in p_list: rpackages.importr(package, on_conflict="warn")
Expected behavior
it should be able to load the package without any issue
This is due to your environment, that is how R and packages were installed. From the path you provide conda is likely involved. See https://github.com/rpy2/rpy2/issues/771.
I have created a R model using Readxl and haven package and have pickled the model using saveRDS function. Now when i try to load the model using readRDS the package import for readxl and haven packages fail i am using importr and trying to load the readxl package
To Reproduce
packages=[] packages.append({"name": "readxl", "version": "1.3.1"}) p_list = [package["name"] for package in packages] import rpy2.robjects.packages as rpackages for package in p_list: rpackages.importr(package, on_conflict="warn")
Expected behavior it should be able to load the package without any issue
Error unable to load shared object '/opt/miniconda/lib/R/library/readxl/libs/readxl.so': /opt/miniconda/lib/R/library/readxl/libs/readxl.so: undefined symbol: libiconv Calls: -> loadNamespace -> library.dynam -> dyn.load