DS4PS / cpp-527-fall-2020

http://ds4ps.org/cpp-527-fall-2020/
0 stars 1 forks source link

Problem loading library (quanteda) #29

Open RTrehern-ASU opened 3 years ago

RTrehern-ASU commented 3 years ago

Has anyone else had trouble getting library(quanteda) to load? According to my RStudio program, the package is installed, but when I try to call on the library I get the following error message:

"Error: package or namespace load failed for ‘quanteda’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so': dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so, 6): Symbol not found: _EXTPTR_PTR Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so Expected in: /Library/Frameworks/R.framework/Resources/lib/libR.dylib in /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so"

I am using the most current version of RStudio (1.3.1093) and I have updated all packages and dependency packages. I have followed several troubleshooting tips I read on other blogs and sites, but am not able to get it to work. Any suggestions?

lecy commented 3 years ago

It looks like an Rcpp problem, perhaps? That is one off the packages that often fails to install properly.

Are you on a Mac or PC?

RTrehern-ASU commented 3 years ago

I am using a Mac. I updated Rcpp after reading about that problem on a blog yesterday but it didn't fix the issue. From what I can tell, there are some unresolved issues with RStudio and the latest version of MacOS, Catalina. Fortunately, I have an older version of MacOS on my laptop, so I was able to load the package properly and complete the assignment. I will keep researching ways to fix RStudio on my desktop and let you know if I am able to do so.

lecy commented 3 years ago

Got it, thanks for the update.

I'm not sure what to say about the Rcpp problem on the latest MacOS. That package seems to have a lot of conflicts, but is used by a lot of other packages. It seems to bounce back and fourth between R updates breaking it and OS updates breaking it. I'm sure the developers regret creating that package!

On these labs we have 30 students with 30 different combinations of OS systems, OS versions, R versions, and package versions all running the same code. So it's not unusual with all of those permutations that one or two students run into these issues. Congrats on drawing the short straw for this lab.

The annoying part is having to try several fixes to get the program installed. Once you find the right blog or just happen to try the right order or package re-installs that works you should be fine. They usually come out with patches pretty quickly.

In the meantime the lesson here is being able to read errors, make sense of them, and know what to Google.

Here the error came while trying to install quanteda, but it is clear from the messages that it was this library Rcpp.

Error: package or namespace load failed for ‘quanteda’ 
in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object 
'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/Rcpp.so'

If you can identify those types of errors at this point, google Rcpp with Mac issues, and make sense of the discussion boards you find I think you are doing great. At that point you are basically a mechanic that can work on your own car. Maybe not build a replacement part yet, but at least figure out which parts needs replacement to keep it running!

RTrehern-ASU commented 3 years ago

I finally figured out the problem. If you are using MacOS 10.15.X, (aka-Catalina), with R 4.0.2, you must ensure you have GNU Fortran 8.2 installed as well. You can download it from cran.

lecy commented 3 years ago

Thanks for the update!