Mac系统R语言升级后无法加载包报错 package or namespace load failed in dyn.load

简介: Mac系统R语言升级后无法加载包报错 package or namespace load failed in dyn.load

问题重现:

我需要安装R软件包stochvol,该软件包 仅适用于3.6.0版的R。因此,我安装了R(3.6.0 版本),并使用打开它 RStudio。但是现在  ,即使我成功 使用来 安装软件包,也无法加载任何库 。具体来说,我需要加载的库是stochvol  ,Rcpp和 caret。我尝试重新安装 R, 但仍然无法正常工作。

软件:R

环境:Mac osx

我收到的错误消息是

1. install.packages("package_name")
2. caretforecastggplot2Error: package or namespace load failed for ‘forecast’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/libs/Rcpp.so': dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/Rcpp/libs/Rcpp.so, 6): Symbol not found: ___cxa_uncaught_exceptions Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libc++.1.dylib Expected in: /usr/lib/libc++abi.dylib in /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libc++.1.dylib

加载后报错:

使用Rcpp 成功安装软件包 后 install.packages("Rcpp") ,尝试时我仍然收到上面的消息 library(Rcpp)。(在升级之前,一切正常,除了我无法安装 quadprog,所以也无法安装 forecast 软件包)。

 

解决方案:

我了解到,升级到的新版本后,您需要重新编译旧软件包 R。在R 终端中运行以下行

1. update.packages(ask=FALSE,
2. checkBuilt=TRUE,
3. repos="https://cloud.r-project.org")

然后

1. install.packages(c("Rcpp", "caret", "forecast", "ggplot2", "quadprog"),
2. dependencies=TRUE,
3. repos="https://cloud.r-project.org")

 

报错历史截图以及最后成功加载的截图。

 

相关文章
|
Oracle 关系型数据库 Go
【开发工具】解决 Goland 报错:Found several packages [main, xxx] in ...
【开发工具】解决 Goland 报错:Found several packages [main, xxx] in ...
1196 0
【开发工具】解决 Goland 报错:Found several packages [main, xxx] in ...
|
10月前
装R包(package)error:(as ‘lib’ is unspecified)installation of package had non-zero exit status]
装R包(package)error:(as ‘lib’ is unspecified)installation of package had non-zero exit status]
|
机器学习/深度学习 PyTorch 算法框架/工具
|
安全 Apache C++
Creating a package:创建一个软件包
Creating a package:创建一个软件包
159 0
关于catkin_init_workspace找不到命令的原因
关于catkin_init_workspace找不到命令的原因
339 3
关于catkin_init_workspace找不到命令的原因
|
PyTorch 算法框架/工具 C++
导入pytorch报错:Redistributable is not installed...安装vc_redist.x64.exe报错:Error 1402:Could not open key..
导入pytorch报错:Redistributable is not installed...安装vc_redist.x64.exe报错:Error 1402:Could not open key..
导入pytorch报错:Redistributable is not installed...安装vc_redist.x64.exe报错:Error 1402:Could not open key..
|
Python
Python 常见问题 - 使用 poetry build 打包构建失败,报 ModuleOrPackageNotFound No file/folder found for package filesystemfastapi
Python 常见问题 - 使用 poetry build 打包构建失败,报 ModuleOrPackageNotFound No file/folder found for package filesystemfastapi
274 0
Python 常见问题 - 使用 poetry build 打包构建失败,报 ModuleOrPackageNotFound No file/folder found for package filesystemfastapi
【Unity3D 问题总结】Failed to import package with error: Couldn‘t decompress package
报错问题:Failed to import package with error: Couldn’t decompress package 今天在导入一个资源包的时候突然提示报错:Failed to import package with error: Couldn’t decompress package
【Unity3D 问题总结】Failed to import package with error: Couldn‘t decompress package

热门文章

最新文章

http://www.vxiaotou.com