0

Not sure if relevant, but I'm getting this error after a recent update to Mac OS Monterey Version 12.5.1.

After trying library(plotKML) I get the following:

Error: package or namespace load failed for ‘plotKML’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Users/kchalkowski/Library/R/x86_64/4.1/library/lwgeom/libs/lwgeom.so':
  dlopen(/Users/kchalkowski/Library/R/x86_64/4.1/library/lwgeom/libs/lwgeom.so, 0x0006): Library not loaded: '/usr/local/opt/proj/lib/libproj.22.dylib'

I checked the directory /usr/local/opt/proj/lib and sure enough, libproj.22.dylib is not there. Rather, another version is there in it's place: libproj.25.dylib.

Is there a way to get that older version of libproj? or a way to link plotKML to the correct dylib? I had a similar issue with sf, but was able to fix it with a brew reinstall of pkg-config gdal proj geos in the terminal, and uninstalling and reinstalling sf. I've tried uninstalling and reinstalling plotKML but to no avail.

  • I'm not a macos user, but I've seen several related questions, and they generally recommend troubleshooting your homebrew. Perhaps https://docs.brew.sh/Troubleshooting is helpful. – r2evans Aug 24 '22 at 12:35

1 Answers1

0

Did a search for the name of the dynamic library and I think I actually just fixed it following advice here: https://github.com/flow-project/flow/issues/896

I used the following in the terminal but instead of 19/5, I replaced the versions of the libraries in the code here with the one I have (25) and the one plotKML wants (22), and it seems to be working now?:

ln -s /usr/local/opt/proj/lib/libproj.19.dylib /usr/local/opt/proj/lib/libproj.15.dylib