51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

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

英文:

rpy2 loading error with MacOS 13.5 and m1 chip

问题 {#heading}

我在尝试在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 {#1}

得分: 0

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

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


赞(1)
未经允许不得转载:工具盒子 » rpy2在MacOS 13.5和M1芯片上加载错误。