我希望使用 devtools
包 . 我运行以下命令:
> install.packages("devtools", dependencies = TRUE)
....
> library(devtools)
Error in library(devtools) : there is no package called ‘devtools’
我究竟做错了什么?
编辑:以下是重新启动会话后重新运行 install.packages
命令的结果 .
> install.packages("devtools", dependencies = TRUE)
Installing package into ‘/home/evanaad/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Warning: dependencies ‘roxygen2’, ‘BiocInstaller’, ‘rstudio’ are not available
also installing the dependencies ‘httr’, ‘RCurl’
trying URL 'http://cran.at.r-project.org/src/contrib/httr_0.2.tar.gz'
Content type 'application/x-gzip' length 50183 bytes (49 Kb)
opened URL
==================================================
downloaded 49 Kb
trying URL 'http://cran.at.r-project.org/src/contrib/RCurl_1.95-4.1.tar.gz'
Content type 'application/x-gzip' length 870915 bytes (850 Kb)
opened URL
==================================================
downloaded 850 Kb
trying URL 'http://cran.at.r-project.org/src/contrib/devtools_1.4.1.tar.gz'
Content type 'application/x-gzip' length 105214 bytes (102 Kb)
opened URL
==================================================
downloaded 102 Kb
* installing *source* package ‘RCurl’ ...
** package ‘RCurl’ successfully unpacked and MD5 sums checked
checking for curl-config... no
Cannot find curl-config
ERROR: configuration failed for package ‘RCurl’
* removing ‘/home/evanaad/R/x86_64-pc-linux-gnu-library/3.0/RCurl’
ERROR: dependency ‘RCurl’ is not available for package ‘httr’
* removing ‘/home/evanaad/R/x86_64-pc-linux-gnu-library/3.0/httr’
ERROR: dependencies ‘httr’, ‘RCurl’ are not available for package ‘devtools’
* removing ‘/home/evanaad/R/x86_64-pc-linux-gnu-library/3.0/devtools’
The downloaded source packages are in
‘/tmp/RtmptvmTrA/downloaded_packages’
Warning messages:
1: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘RCurl’ had non-zero exit status
2: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘httr’ had non-zero exit status
3: In install.packages("devtools", dependencies = TRUE) :
installation of package ‘devtools’ had non-zero exit status
8 回答
按照_1828758的建议,我安装了libcurl4-gnutls-dev,问题解决了 .
编辑(@dardisco)
在你的shell中:
如果您使用的是Ubuntu / Linux:
如果您使用的是CentOS:
尝试:
如今(ubuntu 14.04)我需要两个:
对于ubuntu用户,请在终端中运行此命令[在UBUNTU 16.04中测试]
以通常在R中使用的方式发布此安装库
对于我的Debian Jessie盒子,我还包括:
提示:r-tool控制台输出非常详细,所以我会检查任何其他依赖项 .
然后,我终于明白了:
解决此问题的最佳解决方案我正在寻找同样的问题 . 我花了1天然后我得到了解决方案 . 现在,这很好 .
如果您使用的是Ubuntu或Linux,请在bash终端中检查您的R版本 .
然后使用这些命令
现在检查R的新版本 . 使用此命令
现在只更新R .
现在R将更新,错误将被删除 . 确保
cd
要安装新软件包的库路径 . 这种方式在bash终端 . 尝试在主文件夹中创建R目录,否则它将处于默认状态 . 找到包〜/ R / lib /的这个位置 .要么
CentOS 7:我已经安装了libcurl和gnutls开发包,但在R中安装devtools时仍然出现“无法加载git2r.so”错误 . 我必须“重新安装”它们才能使用它: