IT박스

devtools 패키지 설치 문제

itboxs 2020. 6. 13. 19:30
반응형

devtools 패키지 설치 문제


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

당으로 damienfrancois 의 제안, 나는 libcurl4-gnutls-dev에 설치하고 문제가 해결되었다.

편집 (@dardisco)

당신의 껍질에서 :

apt-get -y build-dep libcurl4-gnutls-dev
apt-get -y install libcurl4-gnutls-dev

Ubuntu / Linux를 사용하는 경우 :

sudo apt-get install libcurl4-openssl-dev libssl-dev

CentOS를 사용하는 경우 :

시험:

sudo yum -y install libcurl libcurl-devel

요즘 (우분투 14.04) 나는 둘 다 필요합니다.

 $ sudo apt-get -y install libcurl4-gnutls-dev
 $ sudo apt-get -y install libssl-dev

우분투 사용자의 경우 터미널에서이 명령을 실행하십시오 [UBUNTU 16.04에서 테스트 됨]

sudo apt-get -y install libcurl4-openssl-dev

이 설치 라이브러리를 사용하여 R에서 일반적으로하는 방식으로 게시하십시오.

install.packages("package name")

내 데비안 Jessie 상자에는 다음도 포함되었습니다.

sudo apt-get build-dep libxml2-dev

힌트 : r-tool 콘솔 출력은 매우 장황하므로 다른 종속성을 확인합니다.

그런 다음 마침내 얻었습니다.

> find_rtools()
[1] TRUE

Best solution to solve this. I was searching the same problem. I spent 1 day and then I got solution. Now, It is well.

Check your R version in bash terminal if you are on Ubuntu or Linux.

R --version

then use these commands

sudo apt-get update 
sudo apt-get upgrade              

Now check the new version of R. Use this command

sudo apt-cache showpkg r-base

Now update the R only.

sudo apt-get install r-base

Now R will be updated and the error will be removed. Make sure to cd the library path where you want to install the new package. This way in bash terminal. Try to create the R directory at home folder or it will be at the default. Locate this location for package ~/R/lib/ .

R
.libPaths("~/R/lib")
install.packages("devtools")

OR

install.packages("devtools", lib="~/R/lib")

CentOS 7: I had the libcurl and gnutls development packages installed already, but still got the "cannot load git2r.so" error when installing devtools in R. I had to "reinstall" them for it to work:

sudo yum reinstall gnutls-devel.x86_64

I hit this issue with Ubuntu 18.04 and none of the previous answers solved it. Eventually I succeeded by installing devtools with the package manager itself:

sudo apt install r-cran-devtools


Centos 6.8

this work like charm for me

  1. install libcurl $yum -y install libcurl libcurl-devel
  2. restart R Software $rstudio-server verify-installation

참고URL : https://stackoverflow.com/questions/20923209/problems-installing-the-devtools-package

반응형