我正在与安装作斗争knitr,但我无法提供新的解决方案。最后我删除knitr并尝试再次安装。下面是整个过程的控制台,哪里出了问题???每次启动 R studio 并安装新软件包时,我都会收到错误消息(见下文)。
R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"\n Copyright (C) 2014 The R Foundation for Statistical Computing\n Platform: i386-w64-mingw32/i386 (32-bit)\n\n R is free software and comes with ABSOLUTELY NO WARRANTY.\n You are welcome to redistribute it under certain conditions.\n Type \'license()\' or \'licence()\' for distribution details.\n\n R is a collaborative project with many contributors.\n Type \'contributors()\' for more information and\n \'citation()\' on how to cite R or R packages in publications.\n\n Type \'demo()\' for some demos, \'help()\' for on-line help, or\n \'help.start()\' for an HTML browser interface to help.\n Type \'q()\' to quit R.\n\n [Workspace loaded from ~/2016/KNUTSTORP/.RData]\n\n > install.packages("knitr")\n Installing package into \xe2\x80\x98\\\\xxxxx.xxxxx/users/Eke/mali/Documents/R/win-library/3.1\xe2\x80\x99\n (as \xe2\x80\x98lib\xe2\x80\x99 is unspecified)\n also installing the dependencies \xe2\x80\x98mime\xe2\x80\x99, \xe2\x80\x98stringi\xe2\x80\x99, \xe2\x80\x98magrittr\xe2\x80\x99, \xe2\x80\x98evaluate\xe2\x80\x99, \xe2\x80\x98digest\xe2\x80\x99, \xe2\x80\x98formatR\xe2\x80\x99, \xe2\x80\x98highr\xe2\x80\x99, \xe2\x80\x98markdown\xe2\x80\x99, \xe2\x80\x98stringr\xe2\x80\x99, \xe2\x80\x98yaml\xe2\x80\x99\n\n trying URL \'https://cran.rstudio.com/bin/windows/contrib/3.1/mime_0.4.zip\'\n Content type \'application/zip\' length 37255 bytes (36 Kb)\n opened URL\n downloaded 36 Kb\n\n trying URL \'https://cran.rstudio.com/bin/windows/contrib/3.1/stringi_1.0-1.zip\'\n Content type \'application/zip\' length 14266706 bytes (13.6 Mb)\n opened URL\n downloaded 13.6 Mb\n\n trying URL \'https://cran.rstudio.com/bin/windows/contrib/3.1/magrittr_1.5.zip\'\n Content type \'application/zip\' length 152098 bytes (148 Kb)\n opened URL\n downloaded 148 Kb\n\n trying URL \'https://cran.rstudio.com/bin/windows/contrib/3.1/evaluate_0.9.zip\'\n Content type \'application/zip\' length 42030 bytes (41 Kb)\n opened URL\n downloaded 41 Kb\n\n trying URL \'https://cran.rstudio.com/bin/windows/contrib/3.1/digest_0.6.9.zip\'\n Content type \'application/zip\' length 171597 bytes (167 Kb)\n opened URL\n downloaded 167 Kb\n\n trying URL \'https://cran.rstudio.com/bin/windows/contrib/3.1/formatR_1.3.zip\'\n Content type \'application/zip\' length 52426 bytes (51 Kb)\n opened URL\n downloaded 51 Kb\n\n trying URL \'https://cran.rstudio.com/bin/windows/contrib/3.1/highr_0.5.1.zip\'\n Content type \'application/zip\' length 35546 bytes (34 Kb)\n opened URL\n downloaded 34 Kb\n\n trying URL \'https://cran.rstudio.com/bin/windows/contrib/3.1/markdown_0.7.7.zip\'\n Content type \'application/zip\' length 165447 bytes (161 Kb)\n opened URL\n downloaded 161 Kb\n\n trying URL \'https://cran.rstudio.com/bin/windows/contrib/3.1/stringr_1.0.0.zip\'\n Content type \'application/zip\' length 83256 bytes (81 Kb)\n opened URL\n downloaded 81 Kb\n\n trying URL \'https://cran.rstudio.com/bin/windows/contrib/3.1/yaml_2.1.13.zip\'\n Content type \'application/zip\' length 180080 bytes (175 Kb)\n opened URL\n downloaded 175 Kb\n\n trying URL \'https://cran.rstudio.com/bin/windows/contrib/3.1/knitr_1.12.3.zip\'\n Content type \'application/zip\' length 811552 bytes (792 Kb)\n opened URL\n downloaded 792 Kb\n\n package \xe2\x80\x98mime\xe2\x80\x99 successfully unpacked and MD5 sums checked\n package \xe2\x80\x98stringi\xe2\x80\x99 successfully unpacked and MD5 sums checked\n package \xe2\x80\x98magrittr\xe2\x80\x99 successfully unpacked and MD5 sums checked\n package \xe2\x80\x98evaluate\xe2\x80\x99 successfully unpacked and MD5 sums checked\n package \xe2\x80\x98digest\xe2\x80\x99 successfully unpacked and MD5 sums checked\n package \xe2\x80\x98formatR\xe2\x80\x99 successfully unpacked and MD5 sums checked\n package \xe2\x80\x98highr\xe2\x80\x99 successfully unpacked and MD5 sums checked\n package \xe2\x80\x98markdown\xe2\x80\x99 successfully unpacked and MD5 sums checked\n package \xe2\x80\x98stringr\xe2\x80\x99 successfully unpacked and MD5 sums checked\n package \xe2\x80\x98yaml\xe2\x80\x99 successfully unpacked and MD5 sums checked\n package \xe2\x80\x98knitr\xe2\x80\x99 successfully unpacked and MD5 sums checked\n\n The downloaded binary packages are in\n C:\\Users\\mali\\AppData\\Local\\Temp\\RtmpwHvHGn\\downloaded_packages\n Error: invalid version specification \xe2\x80\x98NA\xe2\x80\x99\n In addition: Warning message:\n In utils:::packageDescription(packageName, fields = "Version") :\n no package \'knitr\' was found\nRun Code Online (Sandbox Code Playgroud)\n\n的输出version
> version\n\nplatform i386-w64-mingw32 \narch i386 \nos mingw32 \nsystem i386, mingw32 \nstatus \nmajor 3 \nminor 1.2 \nyear 2014 \nmonth 10 \nday 31 \nsvn rev 66913 \nlanguage R \nversion.string R version 3.1.2 (2014-10-31)\nnickname Pumpkin Helmet \nRun Code Online (Sandbox Code Playgroud)\n\n正如建议我打开了新会话。但错误仍然是一样的。我测试了其他几个软件包,它们工作正常(即 nlme、lme4)
\n\nType \'demo()\' for some demos, \'help()\' for on-line help, or\n\'help.start()\' for an HTML browser interface to help.\nType \'q()\' to quit R.\n\nError: invalid version specification \xe2\x80\x98NA\xe2\x80\x99\nIn addition: Warning message:\nIn utils:::packageDescription(packageName, fields = "Version") :\n no package \'knitr\' was found\n[Workspace loaded from ~/R/TESTER/.RData]\nRun Code Online (Sandbox Code Playgroud)\n\n更奇怪的是,knitr不知何故安装
Error: invalid version specification \xe2\x80\x98NA\xe2\x80\x99\nIn addition: Warning message:\nIn utils:::packageDescription(packageName, fields = "Version") :\n no package \'knitr\' was found\n[Workspace loaded from ~/R/TESTER/.RData]\n\n> library(knitr)\nRun Code Online (Sandbox Code Playgroud)\n\nlibrary通过command加载时不会报错
当我knitr在 Rstudio 中安装时,我收到了这样的评论
Installing packages into \'\\\\xxx.xx/users/Eke/mali/Documents/R/win-library/3.3\'\n(as \'lib\' is unspecified)\nalso installing the dependencies \'mime\', \'stringi\', \'magrittr\', \'Rcpp\'\n\ntrying URL \'https://cran.rstudio.com/bin/windows/contrib/3.3/mime_0.4.zip\'\nContent type \'application/zip\' length 37402 bytes (36 KB)\n==================================================\ndownloaded 36 KB\n\ntrying URL \'https://cran.rstudio.com/bin/windows/contrib/3.3/stringi_1.0-1.zip\'\nContent type \'application/zip\' length 14302873 bytes (13.6 MB)\n==================================================\ndownloaded 13.6 MB\n\ntrying URL \'https://cran.rstudio.com/bin/windows/contrib/3.3/magrittr_1.5.zip\'\nContent type \'application/zip\' length 149726 bytes (146 KB)\n==================================================\ndownloaded 146 KB\n\ntrying URL \'https://cran.rstudio.com/bin/windows/contrib/3.3/Rcpp_0.12.4.zip\'\nContent type \'application/zip\' length 3249212 bytes (3.1 MB)==================================================\ndownloaded 3.1 MB\n\ntrying URL \'https://cran.rstudio.com/bin/windows/contrib/3.3/evaluate_0.9.zip\'\nContent type \'application/zip\' length 41981 bytes (40 KB)\n==================================================\ndownloaded 40 KB\n\ntrying URL \'https://cran.rstudio.com/bin/windows/contrib/3.3/digest_0.6.9.zip\'\nContent type \'application/zip\' length 169286 bytes (165 KB)\n==================================================\ndownloaded 165 KB\n\ntrying URL \'https://cran.rstudio.com/bin/windows/contrib/3.3/formatR_1.3.zip\'\nContent type \'application/zip\' length 52656 bytes (51 KB)\n==================================================\ndownloaded 51 KB\n\ntrying URL \'https://cran.rstudio.com/bin/windows/contrib/3.3/highr_0.5.1.zip\'\nContent type \'application/zip\' length 35637 bytes (34 KB)\n==================================================\ndownloaded 34 KB\n\ntrying URL \'https://cran.rstudio.com/bin/windows/contrib/3.3/markdown_0.7.7.zip\'\nContent type \'application/zip\' length 167151 bytes (163 KB)==================================================\ndownloaded 163 KB\n\ntrying URL \'https://cran.rstudio.com/bin/windows/contrib/3.3/stringr_1.0.0.zip\'\nContent type \'application/zip\' length 83315 bytes (81 KB)\n==================================================\ndownloaded 81 KB\n\ntrying URL \'https://cran.rstudio.com/bin/windows/contrib/3.3/yaml_2.1.13.zip\'\nContent type \'application/zip\' length 175748 bytes (171 KB)\n==================================================\ndownloaded 171 KB\n\ntrying URL \'https://cran.rstudio.com/bin/windows/contrib/3.3/htmltools_0.3.5.zip\'\nContent type \'application/zip\' length 571964 bytes (558 KB)==================================================\ndownloaded 558 KB\n\ntrying URL \'https://cran.rstudio.com/bin/windows/contrib/3.3/caTools_1.17.1.zip\'\nContent type \'application/zip\' length 287027 bytes (280 KB)==================================================\ndownloaded 280 KB\n\ntrying URL \'https://cran.rstudio.com/bin/windows/contrib/3.3/bitops_1.0-6.zip\'\nContent type \'application/zip\' length 36372 bytes (35 KB)\n==================================================\ndownloaded 35 KB\n\npackage \'mime\' successfully unpacked and MD5 sums checked\npackage \'stringi\' successfully unpacked and MD5 sums checked\npackage \'magrittr\' successfully unpacked and MD5 sums checked\npackage \'Rcpp\' successfully unpacked and MD5 sums checked\npackage \'evaluate\' successfully unpacked and MD5 sums checked\npackage \'digest\' successfully unpacked and MD5 sums checked\npackage \'formatR\' successfully unpacked and MD5 sums checked\npackage \'highr\' successfully unpacked and MD5 sums checked\npackage \'markdown\' successfully unpacked and MD5 sums checked\npackage \'stringr\' successfully unpacked and MD5 sums checked\npackage \'yaml\' successfully unpacked and MD5 sums checked\npackage \'htmltools\' successfully unpacked and MD5 sums checked\npackage \'caTools\' successfully unpacked and MD5 sums checked\npackage \'bitops\' successfully unpacked and MD5 sums checked\n\nThe downloaded binary packages are in\n C:\\Users\\mali\\AppData\\Local\\Temp\\RtmpeK2q5y\\downloaded_packages\nInstalling packages into \'\\\\xxxxx.xxxx/users/Eke/mali/Documents/R/win-library/3.3\'\n(as \'lib\' is unspecified)\nalso installing the dependencies \'mime\', \'stringi\', \'magrittr\', \'Rcpp\', \'bitops\', \'evaluate\', \'digest\', \'formatR\', \'highr\', \'markdown\', \'stringr\', \'yaml\', \'htmltools\', \'caTools\'\n\ntrying URL \'https://cran.rstudio.com/src/contrib/mime_0.4.tar.gz\'\nContent type \'application/x-gzip\' length 12545 bytes (12 KB)\n==================================================\ndownloaded 12 KB\n\ntrying URL \'https://cran.rstudio.com/src/contrib/stringi_1.0-1.tar.gz\'\nContent type \'application/x-gzip\' length 3643002 bytes (3.5 MB)==================================================\ndownloaded 3.5 MB\n\ntrying URL \'https://cran.rstudio.com/src/contrib/magrittr_1.5.tar.gz\'\nContent type \'application/x-gzip\' length 200504 bytes (195 KB)==================================================\ndownloaded 195 KB\n\ntrying URL \'https://cran.rstudio.com/src/contrib/Rcpp_0.12.4.tar.gz\'\nContent type \'application/x-gzip\' length 2402065 bytes (2.3 MB)==================================================\ndownloaded 2.3 MB\n\ntrying URL \'https://cran.rstudio.com/src/contrib/bitops_1.0-6.tar.gz\'\nContent type \'application/x-gzip\' length 8734 bytes\n==================================================\ndownloaded 8734 bytes\n\ntrying URL \'https://cran.rstudio.com/src/contrib/evaluate_0.9.tar.gz\'\nContent type \'application/x-gzip\' length 19165 bytes (18 KB)\n==================================================\ndownloaded 18 KB\n\ntrying URL \'https://cran.rstudio.com/src/contrib/digest_0.6.9.tar.gz\'\nContent type \'application/x-gzip\' length 116746 bytes (114 KB)\n==================================================\ndownloaded 114 KB\n\ntrying URL \'https://cran.rstudio.com/src/contrib/formatR_1.3.tar.gz\'\nContent type \'application/x-gzip\' length 28139 bytes (27 KB)==================================================\ndownloaded 27 KB\n\ntrying URL \'https://cran.rstudio.com/src/contrib/highr_0.5.1.tar.gz\'\nContent type \'application/x-gzip\' length 16744 bytes (16 KB)\n==================================================\ndownloaded 16 KB\n\ntrying URL \'https://cran.rstudio.com/src/contrib/markdown_0.7.7.tar.gz\'\nContent type \'application/x-gzip\' length 79427 bytes (77 KB)==================================================\ndownloaded 77 KB\n\ntrying URL \'https://cran.rstudio.com/src/contrib/stringr_1.0.0.tar.gz\'\nContent type \'application/x-gzip\' length 34880 bytes (34 KB)\n==================================================\ndownloaded 34 KB\n\ntrying URL \'https://cran.rstudio.com/src/contrib/yaml_2.1.13.tar.gz\'\nContent type \'application/x-gzip\' length 81045 bytes (79 KB)\n==================================================\ndownloaded 79 KB\n\ntrying URL \'https://cran.rstudio.com/src/contrib/htmltools_0.3.5.tar.gz\'\nContent type \'application/x-gzip\' length 44048 bytes (43 KB)\n==================================================\ndownloaded 43 KB\n\ntrying URL \'https://cran.rstudio.com/src/contrib/caTools_1.17.1.tar.gz\'\nContent type \'application/x-gzip\' length 63358 bytes (61 KB)\n==================================================\ndownloaded 61 KB\n\ntrying URL \'https://cran.rstudio.com/src/contrib/knitr_1.12.3.tar.gz\'\nContent type \'application/x-gzip\' length 830827 bytes (811 KB)==================================================\ndownloaded 811 KB\n\ntrying URL \'https://cran.rstudio.com/src/contrib/rmarkdown_0.9.6.tar.gz\'\nContent type \'application/x-gzip\' length 2013956 bytes (1.9 MB)==================================================\ndownloaded 1.9 MB\n\n\'\\\\xxxx.xxx\\users\\Eke\\mali\\Documents\\R\\TESTER\'\nCMD.EXE was started with the above path as the current directory.\nUNC paths are not supported. Defaulting to Windows directory.\n* installing *source* package \'mime\' ...\n** package \'mime\' successfully unpacked and MD5 sums checked\n** libs\n\n*** arch - i386\nWarning: running command \'make -f "C:/PROGRA~1/R/R-33~1.0/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-33~1.0/share/make/winshlib.mk" SHLIB="mime.dll" OBJECTS="rawmatch.o"\' had status 127\nERROR: compilation failed for package \'mime\'\n* removing \'\\\\xxxx-xxx/users/Eke/mali/Documents/R/win-library/3.3/mime\'\n* restoring previous \'\\\\xxxx.xxxx/users/Eke/mali/Documents/R/win-library/3.3/mime\'\n\'\\\\xxxxx.xxxx\\users\\Eke\\mali\\Documents\\R\\TESTER\'\nCMD.EXE was started with the above path as the current directory.\nUNC paths are not supported. Defaulting to Windows directory.\n* installing *source* package \'stringi\' ...\n** package \'stringi\' successfully unpacked and MD5 sums checked\nWarning: running command \'sh ./configure.win\' had status 127\nERROR: configuration failed for package \'stringi\'\n* removing \'\\\\xxxxxxx.xxxx/users/Eke/mali/Documents/R/win-library/3.3/stringi\'\n* restoring previous \'\\\\xxxxx.xxxx/users/Eke/mali/Documents/R/win-library/3.3/stringi\'\n\'\\\\xxxxx.xxxxxxx\\users\\Eke\\mali\\Documents\\R\\TESTER\'\nCMD.EXE was started with the above path as the current directory.\nUNC paths are not supported. Defaulting to Windows directory.\n* installing *source* package \'magrittr\' ...\n** package \'magrittr\' successfully unpacked and MD5 sums checked\n** R\n** inst\n** byte-compile and prepare package for lazy loading\n** help\n*** installing help indices\n** building package indices\n** installing vignettes\nWarning in file(con, "w") :\n cannot open file \'\\\\xxxxx.xxxxxx/users/Eke/mali/Documents/R/win-library/3.3/magrittr/doc/index.html\': No such file or directory\nError in file(con, "w") : cannot open the connection\nERROR: installing vignettes failed\n* removing \'\\\\xxxxx.xxxxx/users/Eke/mali/Documents/R/win-library/3.3/magrittr\'\n* restoring previous \'\\\\xxxxx.xxxxxx/users/Eke/mali/Documents/R/win-library/3.3/magrittr\'\n\'\\\\xxxxxx.xxxxxx\\users\\Eke\\mali\\Documents\\R\\TESTER\'\nCMD.EXE was started with the above path as the current directory.\nUNC paths are not supported. Defaulting to Windows directory.\n* installing *source* package \'Rcpp\' ...\n** package \'Rcpp\' successfully unpacked and MD5 sums checked\nRun Code Online (Sandbox Code Playgroud)\n\n我遵循@Richie_Cotton 提案,但没有 succ\xc3\xa9s
\n\n> .libPaths()\n[1] "\\\\\\\\xxxxx.xxx/users/Eke/mali/Documents/R/win-library/3.3" "C:/Program Files/R/R-3.3.0/library" \n> .libPaths("\\\\\\\\xxxxxx.xxx/users/Eke/mali/Documents/R/win-library/new")\n> .libPaths()\n[1] "\\\\\\\\xxxxxx.xxx/users/Eke/mali/Documents/R/win-library/new" "C:/Program Files/R/R-3.3.0/library" \n> install.packages("knitr", dependencies = F)\nInstalling package into \xe2\x80\x98\\\\xxxxxx.xxx/users/Eke/mali/Documents/R/win-library/new\xe2\x80\x99\n(as \xe2\x80\x98lib\xe2\x80\x99 is unspecified)\ntrying URL \'https://cran.rstudio.com/bin/windows/contrib/3.3/knitr_1.12.3.zip\'\nContent type \'application/zip\' length 812072 bytes (793 KB)\ndownloaded 793 KB\n\npackage \xe2\x80\x98knitr\xe2\x80\x99 successfully unpacked and MD5 sums checked\n\nThe downloaded binary packages are in\n C:\\Users\\mali\\AppData\\Local\\Temp\\RtmpmwdUSv\\downloaded_packages\nError: invalid version specification \xe2\x80\x98NA\xe2\x80\x99\nIn addition: Warning message:\nIn utils:::packageDescription(packageName, fields = "Version") :\n no package \'knitr\' was found\n> \nRun Code Online (Sandbox Code Playgroud)\n\n我使用taceback但不知道如何翻译结果
5: stop(gettextf("invalid version specification %s", paste(sQuote(unique(x[!ok])), \n collapse = ", ")), call. = FALSE, domain = NA)\n4: .make_numeric_version(x, strict, .standard_regexps()$valid_package_version, \n "package_version")\n3: package_version(utils:::packageDescription(packageName, fields = "Version"))\n2: .rs.getPackageVersion("knitr")\n1: (function (markdownVersion, stitchVersion) \n {\n caps <- list()\n caps$r_markdown_supported = .rs.scalar(FALSE)\n caps$stitch_supported = .rs.scalar(FALSE)\n if (.rs.isPackageInstalled("knitr")) {\n knitrVersion <- .rs.getPackageVersion("knitr")\n caps$r_markdown_supported = .rs.scalar(knitrVersion >= \n markdownVersion)\n caps$stitch_supported = .rs.scalar(knitrVersion >= stitchVersion)\n }\n return(caps)\n })("1.2", "1.2")\n> \nRun Code Online (Sandbox Code Playgroud)\n
从问题中并不清楚问题出在哪里,所以你需要一个策略来定位问题。如果可能,请使用最新版本的 R。
安装软件包时使用新会话。此外,安装到新的库位置,以便您可以准确地看到正在发生的情况。之后您可以随时将此库的内容复制到现有库中。为此,请创建一个您具有写入权限的新目录(可能在您的主文件夹中)。然后,当您调用 时install.packages,使用lib.locargumentmnt 安装到该位置。
不要调用 ,而是install.packages("knitr")一一安装每个依赖项,以查看哪个依赖项导致了问题。即install.packages("mime")、然后install.packages("stringi")、等等。您可以看到问题中所需的所有软件包的列表(或使用packageDescription("knitr").
如果您收到错误,请用于 traceback()查看错误发生的位置,并在您需要进一步帮助时将这些详细信息包含在您的问题中。
| 归档时间: |
|
| 查看次数: |
5240 次 |
| 最近记录: |