无法安装rpy2

无法安装rpy2,r,python-3.6,rpy2,R,Python 3.6,Rpy2,在mac 10.12.6上,pip安装rpy2告诉我“rpy2的构建轮子失败” 我试过了。你知道下一步该看什么吗 以下是错误日志: ---------------------------------------- Failed building wheel for rpy2 Running setup.py clean for rpy2 Failed to build rpy2 Installing collected packages: rpy2 Running setup.p

在mac 10.12.6上,
pip安装rpy2
告诉我“rpy2的构建轮子失败”

我试过了。你知道下一步该看什么吗

以下是错误日志:

  ----------------------------------------
  Failed building wheel for rpy2
  Running setup.py clean for rpy2
Failed to build rpy2
Installing collected packages: rpy2
  Running setup.py install for rpy2 ... error
    Complete output from command /Users/me/Applications/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/c2/tn3m3j415fq7hhh4zwwqrphw0000gn/T/pip-build-v9hm43qh/rpy2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/c2/tn3m3j415fq7hhh4zwwqrphw0000gn/T/pip-1onyudah-record/install-record.txt --single-version-externally-managed --compile:
    R version 3.4.1 (2017-06-30) -- "Single Candle"
    /usr/local/Cellar/r/3.4.1_1/lib/R/bin/R CMD config --ldflags
    /usr/local/Cellar/r/3.4.1_1/lib/R/bin/R CMD config --cppflags

        Compilation parameters for rpy2's C components:
            include_dirs    = ['/usr/local/Cellar/r/3.4.1_1/lib/R/include']
            library_dirs    = ['/usr/local/opt/gettext/lib', '/usr/local/opt/readline/lib', '/usr/local/lib', '/usr/local/opt/gettext/lib', '/usr/local/opt/readline/lib', '/usr/local/lib', '/usr/local/Cellar/r/3.4.1_1/lib/R/lib']
            libraries       = ['R', 'pcre', 'lzma', 'bz2', 'z', 'icucore', 'm', 'iconv']
            extra_link_args = []

    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.6
    creating build/lib.macosx-10.9-x86_64-3.6/rpy2
    copying ./rpy/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2
    copying ./rpy/rpy_classic.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2
    copying ./rpy/situation.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2
    copying ./rpy/tests.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2
    copying ./rpy/tests_rpy_classic.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2
    creating build/lib.macosx-10.9-x86_64-3.6/rpy2/rlike
    copying ./rpy/rlike/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/rlike
    copying ./rpy/rlike/container.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/rlike
    copying ./rpy/rlike/functional.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/rlike
    copying ./rpy/rlike/indexing.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/rlike
    creating build/lib.macosx-10.9-x86_64-3.6/rpy2/rlike/tests
    copying ./rpy/rlike/tests/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/rlike/tests
    copying ./rpy/rlike/tests/test_container.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/rlike/tests
    copying ./rpy/rlike/tests/test_functional.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/rlike/tests
    copying ./rpy/rlike/tests/test_indexing.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/rlike/tests
    creating build/lib.macosx-10.9-x86_64-3.6/rpy2/rinterface
    copying ./rpy/rinterface/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/rinterface
    creating build/lib.macosx-10.9-x86_64-3.6/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_Device.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_EmbeddedR.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_Sexp.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_SexpClosure.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_SexpEnvironment.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_SexpExtPtr.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_SexpSymbol.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_SexpVector.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_SexpVectorNumeric.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/rinterface/tests
    creating build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects
    copying ./rpy/robjects/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects
    copying ./rpy/robjects/constants.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects
    copying ./rpy/robjects/conversion.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects
    copying ./rpy/robjects/environments.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects
    copying ./rpy/robjects/functions.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects
    copying ./rpy/robjects/help.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects
    copying ./rpy/robjects/language.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects
    copying ./rpy/robjects/methods.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects
    copying ./rpy/robjects/numpy2ri.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects
    copying ./rpy/robjects/packages.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects
    copying ./rpy/robjects/packages_utils.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects
    copying ./rpy/robjects/pandas2ri.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects
    copying ./rpy/robjects/robject.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects
    copying ./rpy/robjects/vectors.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects
    creating build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/tests
    copying ./rpy/robjects/tests/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testArray.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testDataFrame.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testEnvironment.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testFormula.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testFunction.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testHelp.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testLanguage.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testMethods.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testNumpyConversions.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testPackages.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testPandasConversions.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testRObject.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testRobjects.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testVector.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/tests
    creating build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/lib
    copying ./rpy/robjects/lib/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/lib
    copying ./rpy/robjects/lib/dbplyr.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/lib
    copying ./rpy/robjects/lib/dplyr.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/lib
    copying ./rpy/robjects/lib/ggplot2.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/lib
    copying ./rpy/robjects/lib/grdevices.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/lib
    copying ./rpy/robjects/lib/grid.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/lib
    copying ./rpy/robjects/lib/test_dplyr.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/lib
    copying ./rpy/robjects/lib/tidyr.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/lib
    creating build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/lib/tests
    copying ./rpy/robjects/lib/tests/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/lib/tests
    copying ./rpy/robjects/lib/tests/test_dplyr.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/lib/tests
    copying ./rpy/robjects/lib/tests/test_ggplot2.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/lib/tests
    copying ./rpy/robjects/lib/tests/test_grdevices.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/robjects/lib/tests
    creating build/lib.macosx-10.9-x86_64-3.6/rpy2/interactive
    copying ./rpy/interactive/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/interactive
    copying ./rpy/interactive/packages.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/interactive
    copying ./rpy/interactive/process_revents.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/interactive
    creating build/lib.macosx-10.9-x86_64-3.6/rpy2/interactive/tests
    copying ./rpy/interactive/tests/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/interactive/tests
    creating build/lib.macosx-10.9-x86_64-3.6/rpy2/ipython
    copying ./rpy/ipython/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/ipython
    copying ./rpy/ipython/ggplot.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/ipython
    copying ./rpy/ipython/html.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/ipython
    copying ./rpy/ipython/rmagic.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/ipython
    creating build/lib.macosx-10.9-x86_64-3.6/rpy2/ipython/tests
    copying ./rpy/ipython/tests/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/ipython/tests
    copying ./rpy/ipython/tests/test_rmagic.py -> build/lib.macosx-10.9-x86_64-3.6/rpy2/ipython/tests
    running build_clib
    building 'r_utils' library
    creating build/temp.macosx-10.9-x86_64-3.6
    creating build/temp.macosx-10.9-x86_64-3.6/rpy
    creating build/temp.macosx-10.9-x86_64-3.6/rpy/rinterface
    clang -DNDEBUG -fwrapv -O2 -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -I./rpy/rinterface -I/usr/local/Cellar/r/3.4.1_1/lib/R/include -c ./rpy/rinterface/r_utils.c -o build/temp.macosx-10.9-x86_64-3.6/./rpy/rinterface/r_utils.o
    In file included from ./rpy/rinterface/r_utils.c:24:
    In file included from /usr/local/Cellar/r/3.4.1_1/lib/R/include/Rdefines.h:36:
    /usr/local/Cellar/r/3.4.1_1/lib/R/include/R_ext/Memory.h:48:17: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    int     R_gc_running();
                        ^
                         void
    In file included from ./rpy/rinterface/r_utils.c:24:
    In file included from /usr/local/Cellar/r/3.4.1_1/lib/R/include/Rdefines.h:40:
    In file included from /usr/local/Cellar/r/3.4.1_1/lib/R/include/Rinternals.h:51:
    /usr/local/Cellar/r/3.4.1_1/lib/R/include/R_ext/Rdynload.h:38:26: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    typedef void * (*DL_FUNC)();
                             ^
                              void
    In file included from ./rpy/rinterface/r_utils.c:24:
    In file included from /usr/local/Cellar/r/3.4.1_1/lib/R/include/Rdefines.h:40:
    /usr/local/Cellar/r/3.4.1_1/lib/R/include/Rinternals.h:919:26: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    const char *R_curErrorBuf();
                             ^
                              void
    3 warnings generated.
    x86_64-apple-darwin13.4.0-ar rc build/temp.macosx-10.9-x86_64-3.6/libr_utils.a build/temp.macosx-10.9-x86_64-3.6/./rpy/rinterface/r_utils.o
    unable to execute 'x86_64-apple-darwin13.4.0-ar': No such file or directory
    error: command 'x86_64-apple-darwin13.4.0-ar' failed with exit status 1

    ----------------------------------------
Command "/Users/me/Applications/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/c2/tn3m3j415fq7hhh4zwwqrphw0000gn/T/pip-build-v9hm43qh/rpy2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/c2/tn3m3j415fq7hhh4zwwqrphw0000gn/T/pip-1onyudah-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/c2/tn3m3j415fq7hhh4zwwqrphw0000gn/T/pip-build-v9hm43qh/rpy2/
答案的开始,尚未生效:

让我来

我随后(对于R>=3.4.0)在
/usr/local
中创建了一个新的目录
clang4
gfortran
。我还按照建议设置了
~/.R/Makevars
文件。(以前我的系统上没有
~/.R
目录)。做这些事情没有明显的效果

我猜我错过了一些基本的东西。我应该重新安装R吗?导出某些环境变量?

答案的开始,尚未生效:

让我来

我随后(对于R>=3.4.0)在
/usr/local
中创建了一个新的目录
clang4
gfortran
。我还按照建议设置了
~/.R/Makevars
文件。(以前我的系统上没有
~/.R
目录)。做这些事情没有明显的效果


我猜我错过了一些基本的东西。我应该重新安装R吗?导出某些环境变量?

可能相关:您通过自制安装了R。你能卸载它,改为安装官方二进制文件,然后按照我的指示操作吗?请尝试第一个。@cbrnr注意,我的错误消息没有提到
fopenmp
——我在该线程中发现了其他相似之处,但您仍然认为您在那里的说明可以解决我的问题吗?如果是这样的话,你能更具体地告诉我应该尝试哪种方法吗?因为这条线上有很多闲聊。你是对的。但正如我提到的,请尝试使用官方的R二进制文件,而不是自制的。另外,除非您通过自制安装了最新的clang,否则您将遇到
-fopenmp
问题。啊,对了--我忘了承认--是的,我确实完全卸载了R,然后从CRAN安装了官方的R二进制文件,但这似乎没有影响任何内容。可能与此相关:您通过自制安装了R。你能卸载它,改为安装官方二进制文件,然后按照我的指示操作吗?请尝试第一个。@cbrnr注意,我的错误消息没有提到
fopenmp
——我在该线程中发现了其他相似之处,但您仍然认为您在那里的说明可以解决我的问题吗?如果是这样的话,你能更具体地告诉我应该尝试哪种方法吗?因为这条线上有很多闲聊。你是对的。但正如我提到的,请尝试使用官方的R二进制文件,而不是自制的。此外,除非您通过自制安装了最新的clang,否则您将遇到
-fopenmp
问题。啊,对了--我忘记承认了--是的,我确实完全卸载了R,然后从CRAN安装了官方的R二进制文件,但这似乎没有影响任何事情。