Import Dataset Error

Hello I recently installed rstudio for a class. During class we were supposed to import a dataset from SPSS. When I click "Import Dataset" I get the error message below. I have restarted Rstudio, and uninstalled and reinstalled Rstudio. It gives me this messaged no matter where I try to import from (SPSS, excel, SAS, and Strata).

"unable to load shared object '/Library/Frameworks/R.framework/Versions/Resources/library/Rcpp/':
dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/, 6): Symbol not found: _EXTPTR_PTR
Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/
Expected in: /Library/Frameworks/R.framework/Resources/lib/libR.dylib
in /Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/libs/"


I just did this and I got the same error code when I tried to import a dataset.

You're on macOS. "Where" did you do install.packages()"? And did you get a message "binary version is available but source version is later" and choose y`?

I installed it via the console in Rstudio. This is what it said:

trying URL ''
Content type 'application/x-gzip' length 3215939 bytes (3.1 MB)
downloaded 3.1 MB

The downloaded binary packages are in

OK. does

library(cpp) # so in this OP, should be Rcpp

from the console do nothing (desired)?

This is what happened when I did that. I am new to R so I am not sure what all of this means.

Loading required package: ineq
Loading required package: kappalab
Loading required package: lpSolve
Loading required package: quadprog
Loading required package: kernlab

Attaching package: ‘kappalab’

The following object is masked from ‘package:ineq’:


Loading required package: mc2d
Loading required package: mvtnorm

Attaching package: ‘mc2d’

The following objects are masked from ‘package:base’:

pmax, pmin

Warning messages:
1: package ‘CPP’ was built under R version 4.0.2
2: package ‘ineq’ was built under R version 4.0.2
3: package ‘kappalab’ was built under R version 4.0.2
4: package ‘lpSolve’ was built under R version 4.0.2
5: package ‘quadprog’ was built under R version 4.0.2
6: package ‘kernlab’ was built under R version 4.0.2
7: package ‘mc2d’ was built under R version 4.0.2
8: package ‘mvtnorm’ was built under R version 4.0.2

That's good. The warnings are just that, meaning you will want to be at R version 4.02 at some point. Let's go back to the top. Does import now work?

No I am still getting the same error message. I installed AFNI through my terminal (my mac terminal, not the terminal in Rstudio) and it had me install some packages for R and now I am nervous I did something to mess it up instead. Could that be what is causing the issue?

I apologize! I meant


Yes I did that, but I am still getting the same error message.

It shouldn't cause problems. For most purposes the mac and RStudio terminals are identical.

Ok, since you know how to use terminal let's try something in it to fix the problem. $ is the mac prompt, not something to enter.

roc@:~$ sudo R
[sudo] password for roc: 

The password is your mac login password.

This will open an R session with a > prompt

> install.packages("RCpp", repos = "")

Let me know.

I did that and that didn't help. But, I uninstalled Rstudio and installed the 4.0.2 version for macOS and that seemed to fix the problem. Maybe I did not have the correct version for my mac. Thank you very much for all of your help!

1 Like

Great. It pays to stay up-to-date within a couple of versions of R and RStudio. It's also good practice to regularly run update.packages()

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.