【问题标题】:Unable to install rpy2无法安装rpy2
【发布时间】:2017-10-22 11:30:22
【问题描述】:

在 mac 10.12.6 上,pip install rpy2 给我“rpy2 构建轮失败”

我试过this。有什么想法接下来要看什么吗?

这是错误日志:

  ----------------------------------------
  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/

【问题讨论】:

  • 您通过 Homebrew 安装了 R。你可以卸载它并安装官方二进制文件,然后按照我的指示here 吗?先试试easiest fix
  • @cbrnr 请注意,我的错误消息没有提到fopenmp——我在该线程中发现了其他相似之处,但您仍然认为您的说明可以解决我的问题吗?如果是这样,您能否更具体地说明要尝试哪种方法,因为该线程上有很多聊天内容?
  • 你是对的。但正如我所提到的,请尝试使用官方 R 二进制文件而不是 Homebrew 二进制文件。此外,除非您通过 Homebrew 安装最新的 clang,否则您将遇到 -fopenmp 问题。
  • 啊,对了——我忘了​​承认——是的,我确实完全卸载了 R,然后从 CRAN 安装了官方的 R 二进制文件,但这似乎没有任何影响。

标签: r python-3.6 rpy2


【解决方案1】:

一个答案的开始,还没有工作:

A/the rpy2 developer pointed我到this

我关注the instructions here(对于 R >= 3.4.0)在/usr/local 中生成了一个新目录clang4gfortran。我还按照建议设置了~/.R/Makevars 文件。 (以前我的系统上没有 ~/.R 目录)。做这些事情没有明显效果。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-10-28
    • 1970-01-01
    • 2018-06-04
    • 1970-01-01
    • 2019-02-03
    • 2016-09-20
    • 2014-04-29
    • 2016-07-06
    相关资源
    最近更新 更多