系统: Ubuntu 18.04
出现的原始错误促使我尝试重新安装R和依赖项:
Error: package or namespace load failed for 'lubridate' in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/usr/local/lib/R/site-library/stringi/libs/stringi.so': libicui18n.so.57: cannot open shared object file: No such file or directory
重现的步骤:
apt install r-base
install.packages(c("dplyr", "lubridate", "qcc", "forecast"), repos='http://cran.us.r-project.org')
安装期间显示的错误:
/usr/local/lib/R/site-library/BH/include/boost/smart_ptr/scoped_ptr.hpp:74:31: warning: 'template<class> class std::auto_ptr' is deprecated
安装后显示的错误:
The downloaded source packages are in
'/tmp/RtmpnulsEe/downloaded_packages'
Warning message:
In install.packages(c("dplyr", "lubridate", "qcc", "forecast", "stringi"), :
installation of package 'forecast' had non-zero exit status
清除并重新安装r-base
和R依赖项后,我看到了这一点......(已经检查过libcurl4-openssl-dev
是最新版本):
Error: package or namespace load failed for 'forecast' in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/usr/local/lib/R/site-library/curl/libs/curl.so':
/usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by /usr/local/lib/R/site-library/curl/libs/curl.so)
更新:显然它是forecast
库中的内容,因为我重现了这样的错误:
$ R
> library(forecast)
Error: package or namespace load failed for 'forecast' in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/usr/local/lib/R/site-library/curl/libs/curl.so':
/usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by /usr/local/lib/R/site-library/curl/libs/curl.so)
答案 0 :(得分:3)
您最初的问题是stringi
是根据libicu
的发行版包版本构建的。由于此分发包不知道/ usr / local中有lubridate
,因此它会更改并中断。
有很多方法可以解决这个问题。最简单(也是最窄的)是确保安装了libicu-dev
。然后,您可以重新安装(即:重建stringi
),然后加载lubridate
。
对于其他人来说,你只是疯狂地扔掉一切可以移动到墙上的东西。您需要花点时间意识到您可以 将所有这些安装为二进制文件(即来自启动板上的Michael Rutter PPA),或者来自源代码。你的来电。我有一个较旧的答案解释差异here(以及此处的其他后续内容),我们也帮助r-sig-debian
列表。
但简而言之:阅读此README at CRAN(特别是前几段)并考虑PPA。
答案 1 :(得分:1)
尝试以下操作后(在每个步骤之间清除并重新安装R):
apt purge r-base
Release not found
。'CURL_OPENSSL_3' not found
)。'CURL_OPENSSL_3' not found
)。阅读this article并在R:
中执行以下操作> remove.packages("curl")
> install.packages("curl")
> install.packages(c("dplyr", "lubridate", "qcc", "forecast", "stringi", "curl"), repos='http://cran.us.r-project.org')
一切都按预期运作。