24

I saw a version of this question posted, but still did not see the answer. I am trying to use ggplot2 but get the following errors (everything worked this morning using R3.0.2 'frisbee sailing' with RStudio version 0.98.1102.

I updated both R and Rstudio and now get the following:

library(ggplot)
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
           there is no package called ‘stringi’
            Error: package or namespace load failed for ‘ggplot2’

So naturally I tried:

> install.packages('stringi')

**There is a binary version available but the source version is later:
    binary source needs_compilation
 stringi  0.4-1  0.5-2             FALSE**

 installing the source package ‘stringi’

trying URL 'http://cran.rstudio.com/src/contrib/stringi_0.5-2.tar.gz'
Content type 'application/x-gzip' length 3641292 bytes (3.5 MB)
==================================================
downloaded 3.5 MB

* installing *source* package ‘stringi’ ...
** package ‘stringi’ successfully unpacked and MD5 sums checked
checking for local ICUDT_DIR... icu55/data
checking for R_HOME... /Library/Frameworks/R.framework/Resources
checking for R... /Library/Frameworks/R.framework/Resources/bin/R
checking for R >= 3.1.0... yes
checking for cat... /bin/cat
/Library/Frameworks/R.framework/Resources/bin/config: line 150: make: 

command not found

/Library/Frameworks/R.framework/Resources/bin/config: line 151: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 152: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 153: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 269: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 150: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 151: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 152: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 153: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 269: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 150: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 151: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 152: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 153: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 269: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 150: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 151: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 152: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 153: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 269: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 150: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 151: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 152: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 153: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 269: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 150: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 151: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 152: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 153: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 269: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 150: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 151: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 152: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 153: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 269: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 150: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 151: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 152: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 153: make: command not found
/Library/Frameworks/R.framework/Resources/bin/config: line 269: make: command not found
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/private/var/folders/bq/3jbmwwh553s395pjg1m9h7fr0000gn/T/Rtmpugc1jZ/R.INSTALLc4677f69ffba/stringi':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
ERROR: configuration failed for package ‘stringi’
* removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/stringi’
Warning in install.packages :
  installation of package ‘stringi’ had non-zero exit status

    The downloaded source packages are in
        ‘/private/var/folders/bq/3jbmwwh553s395pjg1m9h7fr0000gn/T/RtmpXvl7fe/downloaded_packages’

Any suggestions on how to get 'stringi' to install? I'm not real familiar with the error output. Should I just try to go back to older versions of R and Rstudio? Ultimately I'm worried that this will be the tip of the iceberg in terms of packages now not working with the updated R

oh and:

 > sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-apple-darwin10.8.0 (64-bit)
Running under: OS X 10.7.5 (Lion)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] plyr_1.8.3   tools_3.2.1  gtable_0.1.2 Rcpp_0.11.6  grid_3.2.1  digest_0.6.8 proto_0.3-10
Community
  • 1
  • 1
Kodiakflds
  • 603
  • 1
  • 4
  • 15
  • It looks like it can't find the `make` command. Not sure how to get it on a Mac though... It's built in to Linux and comes with cygwin on windows. I'd also suggest you notify the stringi devs to see if/when they plan to release updated binaries (add an issue on their github page). – drammock Jun 25 '15 at 23:25
  • 1
    You could set option `options(install.packages.check.source = "no")` to ignore source versions (which require compiling, which is not working on our platform) during installation (and updates). – Marek Jun 26 '15 at 21:04
  • Thanks for the responses. My personal solution was to retrograde to 3.1.3 "Smooth Sidewalk", and everything worked again. I think I will keep it there while I try to meet some deadlines, and update at a later time – Kodiakflds Jul 10 '15 at 17:37

6 Answers6

23

I had the same problem. Marek's comment above, that install.packages is looking for the source instead of the binary because it's newer, was correct for me too. But his suggestion to use the "options" line didn't work for me for some reason. This, however, did work:

install.packages("stringi",type="mac.binary")

This is much easier than trying to install a compiler through Xcode to process the source package.

ZygD
  • 22,092
  • 39
  • 79
  • 102
robJ
  • 246
  • 1
  • 2
  • This worked for me, although I'd like to note that at least one mirror (ON, Canada) was lacking compiled binaries. BC, Canada had the compiled binary, which is how I ended up getting it. – Zachary Jacobi Aug 05 '15 at 20:11
  • 1
    install.packages("stringi",type="win.binary") works on windows 7!thanks – huangli Oct 26 '15 at 08:55
  • 18
    thanks! `install.packages("stringi",type="win.binary")` for Windows 10 too. – puslet88 Nov 02 '15 at 14:03
  • 2
    For Mavericks and later: install.packages("stringi",type="mac.binary.mavericks") – Javier Feb 10 '17 at 05:30
  • This worked for me on MacOS 12 Monterey when I was otherwise getting stuck in a a loop of `** libsclang++ -std=gnu++11 -I"/usr/local/Cellar ...`. Leaving my error here for others who might be seeing the same. Thank you! – benwshul Jul 19 '22 at 19:41
5

You are victim of install.packages.check.source options which cause R to try install package from sources if sources are newer than binary. Which happens when package is updated (binaries shows up <72 after sources). Which was a case with stringi (look at messages you got: here is a binary version available but the source version is later).

I set

options(install.packages.check.source = "no")

in my .Rprofile file to not be worried by install.packages. All I need to do is wait for binaries to be compiled.

Marek
  • 49,472
  • 15
  • 99
  • 121
5

I tried install.packages("stringi") and it caused my R Studio to stop recognizing the packages I had installed.

I solved it by running this command. Hope it helps:

install.packages("stringi", repos="http://cran.rstudio.com/", dependencies=TRUE)
Gilad Green
  • 36,708
  • 7
  • 61
  • 95
yl33
  • 51
  • 1
  • 1
  • Thanks! My initial solution was to revert to older versions of R/ R studio, but I have since updated everything (As well as installed Xcode), and ggplot2 works as well as stringi. I can't say what specifically worked in the end for me, but I am glad to have the issue resolved! Hopefully all these responses will help others too – Kodiakflds Jan 30 '16 at 23:39
3

While running the commands in Rstudio, when a pop-up with a message "Do you want to install from sources the package which needs compilation" appeared, I clicked "No" and it worked! I had initially chosen "Yes". But that did not work for me. Then I read a post here to find out what should be selected. After choosing "No" it worked...

KRM
  • 1,185
  • 2
  • 13
  • 28
1

In windows 8 run R as administrator solved the issue for me.

zac
  • 11
  • 1
0

You need to install the command line tools for Xcode per the instructions here:

https://support.rstudio.com/hc/en-us/articles/200486498-Package-Development-Prerequisites

Nick Kennedy
  • 12,510
  • 2
  • 30
  • 52