gagolews / stringi

Fast and portable character string processing in R (with the Unicode ICU)
https://stringi.gagolewski.com/
Other
304 stars 44 forks source link

Stringi install error on windows #304

Closed Jammcgro123 closed 5 years ago

Jammcgro123 commented 6 years ago

Hi there, I am trying to install package stringi to R version 3.5.0 but i am facing difficulties in doing so. Below i show how i am trying to install and and the error message i recieve.

packageurl<-"https://cran.r-project.org/src/contrib/Archive/stringi/stringi_1.1.6.tar.gz"

install.packages(packageurl, repos=NULL, type="source") trying URL 'https://cran.r-project.org/src/contrib/Archive/stringi/stringi_1.1.6.tar.gz' Content type 'application/x-gzip' length 3647049 bytes (3.5 MB) downloaded 3.5 MB

arch - i386 c:/Rtools/mingw_32/bin/g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-35~1.0/include" -DNDEBUG -I. -Iicu55/ -Iicu55/unicode -Iicu55/common -Iicu55/i18n -DU_STATIC_IMPLEMENTATION -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DUCONFIG_USE_LOCAL -DU_TOOLUTIL_IMPLEMENTATION -DNDEBUG -O2 -Wall -mtune=generic -c stri_ICU_settings.cpp -o stri_ICU_settings.o /bin/sh: c:/Rtools/mingw_32/bin/g++: No such file or directory make: [stri_ICU_settings.o] Error 127 ERROR: compilation failed for package 'stringi'

does anyone have a resolution to this?

gagolews commented 6 years ago

Do you have Rtools installed? see https://cran.r-project.org/bin/windows/Rtools/

vempi commented 6 years ago

I have the same issue with installing stringi. I already installed Rtools, but it still remains error.

installing via 'install.libs.R' to C:/Users/vempi/Documents/R/win-library/3.5/stringi
downloading the ICU data library (icudt)
output path: icu61/data/icudt61l.zip
trying URL 'https://raw.githubusercontent.com/gagolews/stringi/master/src/icu61/data/icudt61l.zip'
Content type 'application/zip' length 10791080 bytes (10.3 MB)
==================================================
downloaded 10.3 MB

icudt fetch successful
decompressing icudt archive icu61/data/icudt61l.zip to: C:/Users/vempi/Documents/R/win-library/3.5/stringi/libs
icudt has been installed successfully

*** arch - x64
Warning in file(con, "r") :
  cannot open file 'C:/PROGRA~1/R/R-35~1.0/etc/x64/Makeconf': No such file or directory
Error in file(con, "r") : cannot open the connection
* removing 'C:/Users/vempi/Documents/R/win-library/3.5/stringi'
In R CMD INSTALL

The downloaded source packages are in
        ‘C:\tmp\RtmpQrg721\downloaded_packages’
Warning message:
In install.packages(NULL, .libPaths()[1L], dependencies = NA, type = type) :
  installation of package ‘stringi’ had non-zero exit status
gagolews commented 6 years ago

'C:/PROGRA~1/R/R-35~1.0/etc/x64/Makeconf': No such file or directory -- you got an ill-configured Rtools chain, presumably

vempi commented 6 years ago

To install stringi, is it required installing Rtools first? If so, I will try it again after uninstalling and reinstall them.

Otherwise, I hope latest version of stringi doesn't have some issues with R 3.5.x.

Thanks for your quick response!

gagolews commented 6 years ago

g++ has not been found in your current PATH -- you too got an ill-configured Rtools chain, presumably

gagolews commented 6 years ago

As a temporary workaround, you can try:

install.packages("https://github.com/gagolews/stringi/raw/master/devel/winbuilder/stringi_1.2.3.zip")

I created a binary version for R 3.5 using https://win-builder.r-project.org/

The win build fails on the CRAN machines (https://cran.r-project.org/web/checks/check_results_stringi.html) with R-release and R-oldrel, but R-devel is fine. I asked the CRAN team of the possible reason why icudt download fails there, so far with no response.

maproctor commented 6 years ago

RESOLVED: When prompted with a windows dialog, I said "No" to building... This let me install.packages('stringr') and install.packages('swirl') in my case.

It seems like building from scratch uses a hard coded path on c: drive, whereas I have my R files elsewhere.

arch - i386 c:/Rtools/mingw_32/bin/g++ -std=gnu++11 -I"P:/R/R-3.5.1/include" -DNDEBUG -I. -Iicu61/ -Iicu61/unicode -Iicu61/common -Iicu61/i18n -DU_STATIC_IMPLEMENTATION -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DUCONFIG_USE_LOCAL -DU_TOOLUTIL_IMPLEMENTATION -DNDEBUG -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -DU_USE_STRTOD_L=0 -O2 -Wall -mtune=generic -c stri_ICU_settings.cpp -o stri_ICU_settings.o c:/Rtools/mingw_32/bin/g++: not found make: [stri_ICU_settings.o] Error 127 ERROR: compilation failed for package 'stringi'

  • removing 'P:/R/R-3.5.1/library/stringi' In R CMD INSTALL Warning in install.packages : installation of package ‘stringi’ had non-zero exit status

https://stackoverflow.com/questions/39090983/rcpp-rtools-installed-but-error-message-g-not-found

kambanane commented 6 years ago

I get this error:

Error: package ‘stringi’ is not installed for 'arch = x64'

Any idea what I should do?

kambanane commented 6 years ago

I attempted this:

install.packages("https://github.com/gagolews/stringi/raw/master/devel/winbuilder/stringi_1.2.3.zip")

and got this error:

Installing package into ‘C:/Users/anfangen/Documents/R/win-library/3.5’ (as ‘lib’ is unspecified) Warning in install.packages : package ‘https://github.com/gagolews/stringi/raw/master/devel/winbuilder/stringi_1.2.3.zip’ is not available (for R version 3.5.1)

And cannot use stringi, which has prevented me from using my existing code. How can I resolve this?

younusa commented 6 years ago

Getting the same error. Has anyone found the workaround for this?

yutannihilation commented 6 years ago

If you set repos option in your .Rprofile or elsewhere, you need to specify repos = NULL explicitly, since the default value of repos of install.packages() is getOption("repos").

Besides, the URL seems wrong... 🙄 Now zip file is here: https://github.com/gagolews/stringi/blob/master/devel/winbuilder/3.5/stringi_1.2.4.zip

So, you can do this:

install.packages(
    "https://github.com/gagolews/stringi/raw/master/devel/winbuilder/3.5/stringi_1.2.4.zip",
    repos = NULL,
)

c.f. ?install.packages:

If repos = NULL, a character vector of file paths of ‘.zip’ files containing binary builds of packages. (http:// and file:// URLs are also accepted and the files will be downloaded and installed from local copies.)

younusa commented 6 years ago

@yutannihilation WOW! THANK YOU! I was working on this issue for over 5 hours and you solved the mystery. Thank you so much.

moscowbaby commented 6 years ago

Excuse me, I tried to instal as bellow but I got this error

install.packages("https://github.com/gagolews/stringi/raw/master/devel/winbuilder/3.5/stringi_1.2.4.zip", repos = NULL) Installing package into ‘C:/Users/Minh Nguyen/Documents/R/win-library/3.5’ (as ‘lib’ is unspecified) trying URL 'https://github.com/gagolews/stringi/raw/master/devel/winbuilder/3.5/stringi_1.2.4.zip' Warning in install.packages : InternetOpenUrl failed: 'The operation timed out' Error in download.file(p, destfile, method, mode = "wb", ...) : cannot open URL 'https://github.com/gagolews/stringi/raw/master/devel/winbuilder/3.5/stringi_1.2.4.zip'

yutannihilation commented 6 years ago

InternetOpenUrl failed: 'The operation timed out'

I have no idea, but it seems you have a network problem. Maybe you can download the zip file via web browser and install it locally with the path to the downloaded file.

install.packages(
    "/path/to/stringi_1.2.4.zip",
    repos = NULL
)
moscowbaby commented 6 years ago

InternetOpenUrl failed: 'The operation timed out'

I have no idea, but it seems you have a network problem. Maybe you can download the zip file via web browser and install it locally with the path to the downloaded file.

install.packages(
    "/path/to/stringi_1.2.4.zip",
    repos = NULL
)

Thank you very much, it works!