rpy2在MacOS 13.5和M1芯片上加载错误。

huangapple go评论121阅读模式
英文:

rpy2 loading error with MacOS 13.5 and m1 chip

问题

我在尝试在Jupyter Notebook(Python)上执行%load_ext rpy2.ipython时遇到以下错误。

错误:

> OSError: 无法加载库 '/Library/Frameworks/R.framework/Resources/lib/libR.dylib': dlopen(/Library/Frameworks/R.framework/Resources/lib/libR.dylib, 0x0002): 尝试: '/Library/Frameworks/R.framework/Resources/lib/libR.dylib' (mach-o文件,但是不兼容的架构(有 'arm64',需要 'x86_64' )), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/R.framework/Resources/lib/libR.dylib' (没有这个文件), '/Library/Frameworks/R.framework/Resources/lib/libR.dylib' (mach-o文件,但是不兼容的架构(有 'arm64',需要 'x86_64')), '/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libR.dylib' (mach-o文件,但是不兼容的架构(有 'arm64',需要 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libR.dylib' (没有这个文件), '/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libR.dylib' (mach-o文件,但是不兼容的架构(有 'arm64',需要 'x86_64'))

我使用的是MacOS 13.5,我的Mac上有M1芯片。

对于这个问题有任何想法吗?如何在我的环境中使用rpy2?谢谢!

英文:

I have the following error when trying to do %load_ext rpy2.ipython on Jupyter Notebook (Python).

Error:

> OSError: cannot load library '/Library/Frameworks/R.framework/Resources/lib/libR.dylib': dlopen(/Library/Frameworks/R.framework/Resources/lib/libR.dylib, 0x0002): tried: '/Library/Frameworks/R.framework/Resources/lib/libR.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/R.framework/Resources/lib/libR.dylib' (no such file), '/Library/Frameworks/R.framework/Resources/lib/libR.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libR.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libR.dylib' (no such file), '/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libR.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

I am using MacOS 13.5 and my Mac has m1 chip.

Any idea about the issue? How to use rpy2 in my environment? Thanks!

答案1

得分: 0

我通过在我的Mac上安装R-x86_64.pkg也解决了这个问题。

英文:

I figure it out by installing R-x86_64.pkg as well on my Mac.

huangapple
  • 本文由 发表于 2023年8月11日 02:55:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76878620.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定