问题
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