问题
Please help me to install stringr and stringi packages in R. The result is:
install.packages("stringi")
Installing package into ‘C:/Users/kozlovpy/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
пробую URL 'https://mran.revolutionanalytics.com/snapshot/2015-08-27/bin/windows/contrib/3.2/stringi_0.5-5.zip'
Error in download.file(url, destfile, method, mode = "wb", ...) :
не могу открыть URL 'https://mran.revolutionanalytics.com/snapshot/2015-08-27/bin/windows/contrib/3.2/stringi_0.5-5.zip'
Вдобавок: Предупреждение:
В download.file(url, destfile, method, mode = "wb", ...) :
'InternetOpenUrl' не удалось: 'Операция прервана по таймауту'
Предупреждение в download.packages(pkgs, destdir = tmpd, available = available, :
скачивание пакета ‘stringi’ не удалось
sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=Russian_Russia.1251 LC_CTYPE=Russian_Russia.1251 LC_MONETARY=Russian_Russia.1251 LC_NUMERIC=C
[5] LC_TIME=Russian_Russia.1251
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] plyr_1.8.2 tools_3.2.2 gtable_0.1.2 Rcpp_0.11.5 grid_3.2.2 digest_0.6.8 proto_0.3-10
I have tried to follow recomendations in link How should I deal with "package 'xxx' is not available (for R version x.y.z)" warning? , and result is the next (not positive):
- Name is OK
- Just set all possible repositories
- Package is of course in repositories
- 'stringr' is of course a package
- My R is not out of date, I recently upgrated it to 3.2.0 version
- 'stringr' is not an archive package
This did not give positive result:
install.packages("stringr", type = "source")
Installing package into ‘C:/Users/kozlovpy/Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
also installing the dependency ‘stringi’пробую URL 'https://mran.revolutionanalytics.com/snapshot/2015-08-27/src/contrib/stringi_0.5-5.tar.gz'
Content type 'application/octet-stream' length 3639183 bytes (3.5 MB)
downloaded 3.5 MBпробую URL 'https://mran.revolutionanalytics.com/snapshot/2015-08-27/src/contrib/stringr_1.0.0.tar.gz'
Content type 'application/octet-stream' length 34880 bytes (34 KB)
downloaded 34 KB- installing source package 'stringi' ...
** пакет 'stringi' удачно распакован, MD5 sums проверены
Предупреждение: работающая команда 'sh ./configure.win' имеет статус 127
ERROR: configuration failed for package 'stringi' - removing 'C:/Users/kozlovpy/Documents/R/win-library/3.2/stringi'
ERROR: dependency 'stringi' is not available for package 'stringr' - removing 'C:/Users/kozlovpy/Documents/R/win-library/3.2/stringr'
Скачанные исходники пакетов находятся в
‘C:\Users\kozlovpy\AppData\Local\Temp\RtmpgnfwL4\downloaded_packages’
Предупреждения:
1: работающая команда '"C:/PROGRA~1/RRO/R-32~1.2/bin/x64/R"
CMD INSTALL -l "C:\Users\kozlovpy\Documents\R\win-library\3.2"
C:\Users\kozlovpy\AppData\Local\Temp\RtmpgnfwL4/downloaded_packages/stringi_0.5-5.tar.gz' имеет статус 1
2: В install.packages("stringr", type = "source") :
установка пакета ‘stringi’ имеет ненулевой статус выхода
3: работающая команда '"C:/PROGRA~1/RRO/R-32~1.2/bin/x64/R"
CMD INSTALL -l "C:\Users\kozlovpy\Documents\R\win-library\3.2"
C:\Users\kozlovpy\AppData\Local\Temp\RtmpgnfwL4/downloaded_pac
kages/stringr_1.0.0.tar.gz' имеет статус 1
4: В install.packages("stringr", type = "source") :
установка пакета ‘stringr’ имеет ненулевой статус выхода- installing source package 'stringi' ...
Github packages shows the next:
install_github("hadley/stringr")
Downloading github repo hadley/stringr@master
Ошибка в loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘stringi’
install_github("Rexamine/stringi")
Downloading github repo Rexamine/stringi@master
Ошибка в loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘stringi’options(install.packages.check.source = "no") didn't help too
- Trying to enter different repos - no hopes.
Any guesses what am I doing wrong?
回答1:
Sir, I tried this:
install.packages("stringi", dependencies=TRUE, INSTALL_opts = c('--no-lock'))
install.packages("stringr", dependencies=TRUE, INSTALL_opts = c('--no-lock'))
and it worked for me, give it a try!
回答2:
In my case only combining of two options worked:
running as admin and then:
install.packages("stringi", dependencies=TRUE, INSTALL_opts = c('--no-lock'))
回答3:
u/Joyvalley's answer to a similar question worked. Just run R as superuser and install stringi
then:
sudo -i R
回答4:
Installing the newest version of Rtools worked for me.
https://cran.r-project.org/bin/windows/Rtools/
来源:https://stackoverflow.com/questions/34201742/installation-of-packages-stringr-and-stringi-had-non-zero-exit-status