Installing Rpy2 on Mac OSX with Anaconda Python 3.4 and R 3.1 installed via Macports

时间秒杀一切 提交于 2020-01-05 12:12:30

问题


pip install rpy2 yields the error:

/usr/bin/clang -bundle -undefined dynamic_lookup -L/Users/jeff/anaconda3/lib -arch x86_64 build/temp.macosx-10.5-x86_64-3.4/./rpy/rinterface/_rinterface.o -L/Users/jeff/anaconda3/lib -L/opt/local/Library/Frameworks/R.framework/Resources/lib -lR -lRlapack -licui18n -lRblas -o build/lib.macosx-10.5-x86_64-3.4/rpy2/rinterface/_rinterface.so

ld: library not found for -licui18n

clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: command '/usr/bin/clang' failed with exit status 1


I had installed rpy2 with MacPorts. Suggestions? Thanks!


回答1:


If you are not too picky about the R version, you can uninstall the Macports R and install rpy2 and R together with conda: https://binstar.org/r/rpy2

If you really want to use the R you have installed with MacPorts, that would make me kind of sad (hint: brew install r). But you can use conda to create your own rpy2 recipe that uses whatever R it finds installed, something like this (assumes you have R in your PATH):

conda skeleton pypi rpy2
conda build rpy2
conda install rpy2 --use-local


来源:https://stackoverflow.com/questions/24987932/installing-rpy2-on-mac-osx-with-anaconda-python-3-4-and-r-3-1-installed-via-macp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!