program story

오류 : ggplot2 및 data.table에 대한 패키지 또는 네임 스페이스로드 실패

inputbox 2020. 11. 11. 20:01
반응형

오류 : ggplot2 및 data.table에 대한 패키지 또는 네임 스페이스로드 실패


ggplot2 및 data.table 패키지 설치를 열 수 없습니다. 다음과 같은 오류가 발생합니다 (ggplot2의 예).

> library(ggplot2)
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  there is no package called ‘Rcpp’
Error: package or namespace load failed for ‘ggplot2’

R 세션을 닫기 전에이 두 패키지로 잘 작업 할 수있었습니다. 이제 실행하려고 할 때마다이 오류가 표시됩니다.

나는 또한 그것을 제거하고 다시 설치하려고 시도했지만 성공하지 못했습니다.

remove.packages(c("ggplot2", "data.table"))
install.packages('ggplot2', dep = TRUE)
install.packages('data.table', dep = TRUE)

무엇이 잘못되었는지 잘 모르겠습니다.


이것은 문제를 해결했습니다.

remove.packages(c("ggplot2", "data.table"))
install.packages('Rcpp', dependencies = TRUE)
install.packages('ggplot2', dependencies = TRUE)
install.packages('data.table', dependencies = TRUE)

수많은 Google 검색과 Burteforce 시도로 거위를 쫓은 후이 문제를 해결하는 방법을 찾은 것 같습니다.

문제를 해결하기 위해 취한 단계 :

  1. R 제거
  2. R 재설치
  3. install.packages에 대한 종속성 인수를 TRUE로 설정하여 ggplot을 설치하십시오.

    install.packages("ggplot2",dependencies = TRUE)

  4. 위의 단계는 여전히 Rcpp 종속성을 포함하지 않으므로 다음 명령을 사용하여 수동으로 설치해야합니다.

    install.packages("Rcpp")

그러나 위의 명령이 Rcpp를 성공적으로 다운로드하는 동안 어떤 이유로 든 ZIP 파일을 분해하고 다음 오류를 인용하여 내 R의 라이브러리 폴더에 설치하는 데 실패합니다.

'Rcpp'패키지의 압축이 성공적으로 풀리고 MD5 합계가 확인 됨 install.packages에서 경고 : 임시 설치 'C : \ Root_Prgs \ Data_Science_SW \ R \ R-3.2.3 \ library \ file27b8ef47b6d \ Rcpp'를 'C : \ Root_Prgs \로 이동할 수 없습니다. Data_Science_SW \ R \ R-3.2.3 \ library \ Rcpp '

다운로드 한 바이너리 패키지는 C : \ Users \ MY_USER_ID \ AppData \ Local \ Temp \ Rtmp25XQ0S \ downloaded_packages에 있습니다.

  1. 위의 출력은 "Warning"이지만 실제로는 저장소 내에 Rcpp 패키지를 성공적으로 설치하지 못했음을 나타냅니다. 그런 다음 도구-> 패키지 설치-> ZIP 파일을 사용하고 위의 메시지에서 "다운로드 한 바이너리 패키지"의 위치를 ​​가리 켰습니다.

C:\Users\MY_USER_ID\AppData\Local\Temp\Rtmp25XQ0S\downloaded_packages\Rcpp_0.12.3.zip

  1. 이로 인해 R \ R-3.2.3 \ library 폴더에 Rcpp가 성공적으로 설치되어 ggplot2 용 라이브러리를로드하려고 할 때 Rcpp를 사용할 수 있습니다. 이전에 R을 설치하면 Rcpp를 가져올 수 없다는 오류가 발생하기 때문에 이전에는이 ​​단계를 수행 할 수 없었습니다. 그러나 ODD 인 R을 제거하고 다시 설치 한 후에도 동일한 명령이 작동했습니다.

    install.packages ( "C : /Users/MY_USER_ID/AppData/Local/Temp/Rtmp25XQ0S/downloaded_packages/Rcpp_0.12.3.zip", repos = NULL, type = "win.binary") 패키지 'Rcpp'가 성공적으로 압축 해제되고 MD5 합계 체크

  2. 마침내 ggplot2 라이브러리를 성공적으로로드 할 수있었습니다.

    library(ggplot2)


나는 또한 같은 문제에 직면했고

remove.packages(c("ggplot2", "data.table"))
install.packages('Rcpp', dependencies = TRUE)
install.packages('ggplot2', dependencies = TRUE)

이 명령은 나를 위해 작동하지 않았습니다. 내가 찾은 것은 임시 설치 C:\Users\User_name\Documents\R\win-library\3.3\abcd1234\Rcpp으로 이동할 수 없다는 경고 메시지를 표시한다는 것 C:\Users\User_name\Documents\R\win-library\3.3\Rcpp입니다.

주어진 링크에서 Rcpp zip 파일을 다운로드하고 압축을 풀고 내부에 복사 C:\Users\User_name\Documents\R\win-library\3.3한 다음

library(Rcpp)
library(ggplot2) 

일했다. R을 제거 할 필요는 없었습니다.


같은 문제에 직면하여 다음과 같이 해결했습니다.

remove.packages("ggplot2")
install.packages('ggplot2', dependencies = TRUE)

당신이 볼 때

컴파일이 필요한 패키지를 소스에서 설치 하시겠습니까? (예 / 아니요 / 취소)

아니오 대답


이 시도:

install.packages('Rcpp')
install.packages('ggplot2')
install.packages('data.table')

I tried the steps mentioned in the earlier posts but without any success. However, what worked for me was uninstalling R completely and then deleting the R folder which files in the documents folder, so basically everything do with R except the scripts and work spaces I had saved. I then reinstalled R and ran

remove.packages(c("ggplot2", "data.table"))
install.packages('Rcpp', dependencies = TRUE)
install.packages('ggplot2', dependencies = TRUE)
install.packages('data.table', dependencies = TRUE)

This rather crude method somehow worked for me.


I tried all the listed solutions above but nothing worked. This is what worked for me.

  1. Look at the complete error message which you get when you use library(ggplot2).
  2. It lists a couple of packages which are missing or have errors.
  3. Uninstall and reinstall them.
  4. ggplot should work now with a warning for version.

These steps work for me:

  1. Download the Rcpp manually from WebSite (https://cran.r-project.org/web/packages/Rcpp/index.html)
  2. unzip the folder/files to "Rcpp" folder
  3. Locate the "library" folder under R install directory Ex: C:\R\R-3.3.1\library
  4. Copy the "Rcpp" folder to Library folder.

Good to go!!!

library(Rcpp)
library(ggplot2) 

For me, i had to uninstall R from brew brew uninstall --force R and then head over to the R website and download and install it from there.


I had this same problem, but when running in a jupyter R notebook in an Anaconda environment.

The problem presented in such a way that any R notebook opened would instantly die and would not allow cell execution. The error would show up with each failed automated attempt to start the kernel:

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  there is no package called ‘Rcpp’

To solve this, I ran as admin/sudo: conda install -c r r-rcpp, restarted the kernel, and everything was back to normal.

참고URL : https://stackoverflow.com/questions/31717850/error-package-or-namespace-load-failed-for-ggplot2-and-for-data-table

반응형