randy3k / radian

A 21 century R console
MIT License
2k stars 76 forks source link

Undefined symbol error in radian but not in base R #396

Closed arbreazeale closed 1 year ago

arbreazeale commented 1 year ago

OS: Fedora 37 radian version: 0.6.4 r version: 4.2.2

Problem:

When I open R (via terminal command R) and use library("sf"), I have no issues. The package loads correctly and operations execute correctly. When I open radian (via terminal command radian) and use library("sf"), I receive the following error:

Error: package or namespace load failed for 'sf' in dyn.load(file, DLLpath = DLLpath, ...): 
 unable to load shared object '/home/arbreazeale/R/x86_64-redhat-linux-gnu-library/4.2/sf/libs/sf.so':
  /lib64/libgdal.so.31: undefined symbol: opj_decoder_set_strict_mode

What I've done:

I've done a completely clean install of everything because I wanted to make sure there was no other installs of R, python, etc. causing issues. That is, I did the following:

  1. Clean install of Fedora 37 (erasing everything)
  2. Updated packages using sudo dnf update
  3. Installed Anaconda via the .sh file
  4. Updated Anaconda using conda update --all
  5. Installed R using sudo dnf install R
  6. Installed radian using conda install -c conda-forge radian
  7. Installed sf dependencies using sudo dnf install gdal-devel proj-devel geos-devel sqlite-devel udunits2-devel
  8. Launched terminal, opened a radian instance using radian
  9. From within radian, installed sf using install.packages("sf")
  10. From within radian, attempted to use the package via library("sf") and received the error
  11. Quit radian using q() and opened R using R
  12. Loaded the package via library("sf") without issue

I'm not sure what I can do to fix this issue. Any help would be welcome.

Thank you!

randy3k commented 1 year ago

It is usually the issue of having conda python and a native R. It is recommanded to install both python and R in the same ecosystem if you prefer using conda.

arbreazeale commented 1 year ago

Thank you! I went with removing Anaconda and using the pip install instead. For anyone else who finds this issue, that solved the problem completely!