[英]Error: package or namespace load failed, object … not found
我正在運行新安裝的R(3.5.0)和RStudio(1.1.414)。 [請注意,我現在已更新至3.5.1和1.1.453,除了“在R版本3.5.1下構建”警告消息外,仍在遇到以下問題]
我已經使用install.packages("rlang")
安裝了rlang軟件包,沒有遇到任何問題,但是當我嘗試加載該軟件包時,出現以下錯誤
Error: package or namespace load failed for 'rlang': .onLoad failed in loadNamespace() for 'rlang', details: call: dots_list(...) error: object 'rlang_dots_list' not found In addition: Warning message: package 'rlang' was built under R version 3.5.1
我已經卸載並重新安裝了rlang(在每個命令之間關閉重新啟動RStudio),仍然遇到此錯誤。
我還遇到了與其他軟件包類似的問題(盡管可能完全無關)
RStudio每次啟動時都會發出以下警告
[Workspace loaded from ~/.RData] Error in yaml.load(readLines(con), error.label = error.label, ...) : object 'C_unserialize_from_yaml' not found Error in yaml.load(readLines(con), error.label = error.label, ...) : object 'C_unserialize_from_yaml' not found
庫(devtools)出現以下錯誤
Error: package or namespace load failed for 'devtools' in FUN(X[[i]], ...): no such symbol digest in package //[redacted]/My Documents/R/win-library/3.5/digest/libs/x64/digest.dll In addition: Warning message: package 'devtools' was built under R version 3.5.1
有人在Twitter上詢問packageDescription("rlang")
我已復制了以下輸出,以幫助進行故障排除。
Package: rlang
Version: 0.2.1
Title: Functions for Base Types and Core R and 'Tidyverse' Features
Description: A toolbox for working with base types, core R features like the condition system, and core
'Tidyverse' features like tidy evaluation.
Authors@R: c( person("Lionel", "Henry", ,"lionel@rstudio.com", c("aut", "cre")), person("Hadley", "Wickham",
,"hadley@rstudio.com", "aut"), person("RStudio", role = "cph") )
License: GPL-3
LazyData: true
ByteCompile: true
Depends: R (>= 3.1.0)
Suggests: crayon, knitr, methods, pillar, rmarkdown (>= 0.2.65), testthat, covr
RoxygenNote: 6.0.1
URL: http://rlang.tidyverse.org, https://github.com/r-lib/rlang
BugReports: https://github.com/r-lib/rlang/issues
NeedsCompilation: yes
Packaged: 2018-05-30 13:14:55 UTC; lionel
Author: Lionel Henry [aut, cre], Hadley Wickham [aut], RStudio [cph]
Maintainer: Lionel Henry <lionel@rstudio.com>
Repository: CRAN
Date/Publication: 2018-05-30 14:23:07 UTC
Built: R 3.5.1; x86_64-w64-mingw32; 2018-07-02 15:08:55 UTC; windows
-- File: [redacted]/My Documents/R/win-library/3.5/rlang/Meta/package.rds
您有3個不同的警告(digest,yaml和rlang),每個警告都表明程序包DLL文件已損壞。 安裝軟件包時,您所做的事情非常錯誤。
出現此問題的最常見原因是嘗試在R中加載程序包時更新程序包(可能在另一個進程中!)。 這也可能是由於鎖定dll的防病毒程序錯誤而導致的,阻止了dll的更新。 請嘗試以下步驟:
Rterm
入taskmgr
確保沒有Rterm
或Rgui
進程正在運行。 Documents\\R\\win-library\\3.5\\
以及C:\\Program Files\\R\\R-3.5.x\\library\\
內部的yaml
, rlang
和digest
文件夾(如果也存在)。 library(yaml)
或library(rlang)
應該會給出錯誤,例如: 沒有名為'yaml'的軟件包 。 退出R。 install.packages(c("yaml", "rlang", "digest"))
這類問題幾乎總是來自Windows上的R中的錯誤:如果重新安裝包含編譯代碼的軟件包,並且該軟件包已經加載到R中,則DLL將不會更新。
請嘗試在新的會話上重新安裝rlang。 有時,程序包會在啟動時從.RProfile自動加載,您可以在啟動后通過調用sessionInfo()
進行檢查。
如果將來有人遇到類似問題,請回答我自己的問題。
現在,我們與工作IT部門合作,將其與工作站上的自定義權限相關聯,這意味着R軟件包只能運行到預先指定的庫(在我的情況下為“ C:\\ R \\ R-3.4.3 \\ library”) 。
將軟件包直接安裝到該位置可解決此問題,但由於人們可能要使用自定義位置的所有原因(例如,運行同一軟件包的多個版本,為某些項目保留單獨的庫),因此不希望這樣做。
因此,根據您自己的IT系統,可能會或多或少地實現兩種解決方案。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.