R version 3.4.0 rgdal will not load

[亡魂溺海] 提交于 2021-02-08 08:29:20

问题


I recently installed the latest version of R (3.4.0) and installed all of my packages, but for some reason rgdal will not load and I'm getting this message:

library(rgdal) Error: package or namespace load failed for ‘rgdal’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rgdal/libs/rgdal.so': dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/rgdal/libs/rgdal.so, 6): Library not loaded: /Builds/unix/recipes/build/gdal-2.1.3-obj/libgdal.dylib Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/rgdal/libs/rgdal.so Reason: image not found

I went to the rgdal/libs directory and the rgdal.so file exists, but for some reason doesn't want to load. Anyone else have this issue or a similar one?


回答1:


Try installing RStudio and re-download it from there or type install.packages("rgdal"). If none of these work try installing another package and see if you can run it, because it is either the directory, the package or the version of the package is not compatible with the version of the language.




回答2:


Do you have GDAL OS X frameworks installed? If not, go to William Kyngesburye's site, download and install frameworks in the following order:

  1. GDAL Complete
  2. GSL Framework
  3. FreeType
  4. cairo

After completing this installation, go for steps 2 and 3 of this answer, and then, install rgdal from R.app using these specifications in the install.packages command.

It solved the problem for me, hope it helps you!




回答3:


Seems to be related to my issue posted same day, Unable to load pgirmess library ("image not found") - R 3.4 in Mac OS .

I installed the previous version of R from CRAN (3.3.3), and it works fine. You can have both versions installed at the same time. Maybe not a long term solution but at least a temporary fix so your work can continue.



来源:https://stackoverflow.com/questions/43666753/r-version-3-4-0-rgdal-will-not-load

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!