Error in loadNamespace(name) : there is no package called 'Rcpp'
Solution 1
I think you get that issue when your .libPaths()
differ--in other words run the .libPaths()
function to see the paths stored by R for its use. Then check where RInside
is installed, and make sure Rcpp
is installed there too. It is a setup issue.
In other words, it should work if you have Rcpp
and RInside
installed where the basic R libraries are. Otherwise you have to tell the (embedded) R session about the other location (and before it starts).
There are more Windows users on the list, so you could try asking on rcpp-devel.
Solution 2
- First get your default library locations by command ".Library" in R.
- Get Rcpp package from https://cran.r-project.org/web/packages/Rcpp/index.html.
- Unzip and copy folder "Rcpp" to your default library locations obtained from step1.
Now you are ready to install packages which have dependencies on Rcpp.
Solution 3
Dirk is right in this case, BUT if the .libPaths() does not work, then please also check if you have the latest packages.
I am posting this as an ancillary answer backup which I ran into with the shiny
package backend switch of their code needing Rcpp
!
In this case of getting the "no package" error message, I fixed it by:
Selecting
devtools
package and then using this line below. (if you don't have devtools then get it withinstall.packages("devtools")
devtools::install_github("rstudio/shiny")
The development version of the package handled this better, and added the package as a dependency.
Mods - I realize this is an answer to an old question, but I might help others not wasting an hour like I just did.
Solution 4
You might find it easy if the answers are for both R studio users and non R studio users.
R Studio users
- First get your default library locations by command ".Library" in R.
- Get Rcpp package from https://cran.r-project.org/web/packages/Rcpp/index.html.
- Unzip and copy folder "Rcpp" to your default library locations obtained from step 1, you will find another folder named library, paste the unzip folder in it.
Non R studio Users
- First get your default library locations by command ".libPath" in R.
- Get Rcpp package from https://cran.r-project.org/web/packages/Rcpp/index.html.
- Unzip and copy folder "Rcpp" to your default library locations obtained from step 1, you will find another folder named library, paste the unzip folder in it.
chatzich
Updated on April 26, 2020Comments
-
chatzich about 4 years
I am trying to embed RInside to my application on win7 64-bit system but when I initialize an RInside:
Rin = new RInside(argc, argv);
the following message appears:
Error in loadNamespace(name) : there is no package called 'Rcpp'
This error only occurs with Windows.
-
Dirk Eddelbuettel about 11 yearsVery good -- and in that case it is customary to 'accept an answer' (click on the check mark you see next to it) as well as to 'upvote' it (click on the upward-facing triangle). You can vote on any question, you can accept only questions you asked.
-
Chintan Pathak almost 4 yearsOn Ubuntu, I had to use the command
.libPaths()
from inside an R session, or the commandR -e ".libPaths()"
from the terminal to get the library locations.