为什么在尝试在Mac OSX Sierra上安装rpy2时会出现此错误?

时间:2017-05-23 18:29:19

标签: rpy2

尝试输入

在Mac Sierra上安装rpy2
sudo pip install rpy2
命令行上的

。得到此错误:

The directory '/Users/hodor/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

目录' / Users / hodor / Library / Caches / pip'或其父目录不归当前用户所有,并且已禁用缓存轮。检查该目录的权限和所有者。如果用sudo执行pip,你可能需要sudo的-H标志。 收集rpy2   下载rpy2-2.8.5.tar.gz(184kB)     100%|████████████████████████████████| 184kB 27kB / s 要求已经满足:/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python(来自rpy2) 要求已经满足:/ Library/Python/2.7/site-packages中的singledispatch(来自rpy2) 安装收集的软件包:rpy2   运行setup.py安装rpy2 ...错误     命令/ usr / bin / python -u -c&#34完成输出;导入setuptools,tokenize; 文件 =' / private / tmp / pip-build-0H8VbG / rpy2 / setup .py'; f = getattr(tokenize,' open',open)(文件); code = f.read()。replace(' \ r \ n \ n',' \ n'); f.close(); exec(编译(代码,文件,' exec'))&# 34; install --record /tmp/pip-umxGfs-record/install-record.txt --single-version-external-managed --compile:     R版本3.4.0(2017-04-21) - "你愚蠢的黑暗"     /Library/Frameworks/R.framework/Resources/bin/R CMD config --ldflags     /Library/Frameworks/R.framework/Resources/bin/R CMD config --cppflags

    Compilation parameters for rpy2's C components:
        include_dirs    = ['/Library/Frameworks/R.framework/Resources/include']
        library_dirs    = ['/usr/local/lib']
        libraries       = ['pcre', 'lzma', 'bz2', 'z', 'icucore', 'm', 'iconv']
        extra_link_args = ['-fopenmp', '-F/Library/Frameworks/R.framework/..', '-framework', 'R']

running install
running build
running build_py
creating build
creating build/lib.macosx-10.12-intel-2.7
creating build/lib.macosx-10.12-intel-2.7/rpy2
copying ./rpy/__init__.py -> build/lib.macosx-10.12-intel-2.7/rpy2
copying ./rpy/rpy_classic.py -> build/lib.macosx-10.12-intel-2.7/rpy2
copying ./rpy/tests.py -> build/lib.macosx-10.12-intel-2.7/rpy2
copying ./rpy/tests_rpy_classic.py -> build/lib.macosx-10.12-intel-2.7/rpy2
creating build/lib.macosx-10.12-intel-2.7/rpy2/rlike
copying ./rpy/rlike/__init__.py -> build/lib.macosx-10.12-intel-2.7/rpy2/rlike
copying ./rpy/rlike/container.py -> build/lib.macosx-10.12-intel-2.7/rpy2/rlike
copying ./rpy/rlike/functional.py -> build/lib.macosx-10.12-intel-2.7/rpy2/rlike
copying ./rpy/rlike/indexing.py -> build/lib.macosx-10.12-intel-2.7/rpy2/rlike
creating build/lib.macosx-10.12-intel-2.7/rpy2/rlike/tests
copying ./rpy/rlike/tests/__init__.py -> build/lib.macosx-10.12-intel-2.7/rpy2/rlike/tests
copying ./rpy/rlike/tests/test_container.py -> build/lib.macosx-10.12-intel-2.7/rpy2/rlike/tests
copying ./rpy/rlike/tests/test_functional.py -> build/lib.macosx-10.12-intel-2.7/rpy2/rlike/tests
copying ./rpy/rlike/tests/test_indexing.py -> build/lib.macosx-10.12-intel-2.7/rpy2/rlike/tests
creating build/lib.macosx-10.12-intel-2.7/rpy2/rinterface
copying ./rpy/rinterface/__init__.py -> build/lib.macosx-10.12-intel-2.7/rpy2/rinterface
creating build/lib.macosx-10.12-intel-2.7/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/__init__.py -> build/lib.macosx-10.12-intel-2.7/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_Device.py -> build/lib.macosx-10.12-intel-2.7/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_EmbeddedR.py -> build/lib.macosx-10.12-intel-2.7/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_Sexp.py -> build/lib.macosx-10.12-intel-2.7/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_SexpClosure.py -> build/lib.macosx-10.12-intel-2.7/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_SexpEnvironment.py -> build/lib.macosx-10.12-intel-2.7/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_SexpExtPtr.py -> build/lib.macosx-10.12-intel-2.7/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_SexpSymbol.py -> build/lib.macosx-10.12-intel-2.7/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_SexpVector.py -> build/lib.macosx-10.12-intel-2.7/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_SexpVectorNumeric.py -> build/lib.macosx-10.12-intel-2.7/rpy2/rinterface/tests
creating build/lib.macosx-10.12-intel-2.7/rpy2/robjects
copying ./rpy/robjects/__init__.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects
copying ./rpy/robjects/constants.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects
copying ./rpy/robjects/conversion.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects
copying ./rpy/robjects/environments.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects
copying ./rpy/robjects/functions.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects
copying ./rpy/robjects/help.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects
copying ./rpy/robjects/language.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects
copying ./rpy/robjects/methods.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects
copying ./rpy/robjects/numpy2ri.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects
copying ./rpy/robjects/packages.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects
copying ./rpy/robjects/packages_utils.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects
copying ./rpy/robjects/pandas2ri.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects
copying ./rpy/robjects/robject.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects
copying ./rpy/robjects/vectors.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects
creating build/lib.macosx-10.12-intel-2.7/rpy2/robjects/tests
copying ./rpy/robjects/tests/__init__.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/tests
copying ./rpy/robjects/tests/testArray.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/tests
copying ./rpy/robjects/tests/testDataFrame.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/tests
copying ./rpy/robjects/tests/testEnvironment.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/tests
copying ./rpy/robjects/tests/testFormula.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/tests
copying ./rpy/robjects/tests/testFunction.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/tests
copying ./rpy/robjects/tests/testHelp.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/tests
copying ./rpy/robjects/tests/testLanguage.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/tests
copying ./rpy/robjects/tests/testMethods.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/tests
copying ./rpy/robjects/tests/testNumpyConversions.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/tests
copying ./rpy/robjects/tests/testPackages.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/tests
copying ./rpy/robjects/tests/testPandasConversions.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/tests
copying ./rpy/robjects/tests/testRObject.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/tests
copying ./rpy/robjects/tests/testRobjects.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/tests
copying ./rpy/robjects/tests/testVector.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/tests
creating build/lib.macosx-10.12-intel-2.7/rpy2/robjects/lib
copying ./rpy/robjects/lib/__init__.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/lib
copying ./rpy/robjects/lib/dplyr.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/lib
copying ./rpy/robjects/lib/ggplot2.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/lib
copying ./rpy/robjects/lib/grdevices.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/lib
copying ./rpy/robjects/lib/grid.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/lib
copying ./rpy/robjects/lib/tidyr.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/lib
creating build/lib.macosx-10.12-intel-2.7/rpy2/robjects/lib/tests
copying ./rpy/robjects/lib/tests/__init__.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/lib/tests
copying ./rpy/robjects/lib/tests/test_dplyr.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/lib/tests
copying ./rpy/robjects/lib/tests/test_ggplot2.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/lib/tests
copying ./rpy/robjects/lib/tests/test_grdevices.py -> build/lib.macosx-10.12-intel-2.7/rpy2/robjects/lib/tests
creating build/lib.macosx-10.12-intel-2.7/rpy2/interactive
copying ./rpy/interactive/__init__.py -> build/lib.macosx-10.12-intel-2.7/rpy2/interactive
copying ./rpy/interactive/packages.py -> build/lib.macosx-10.12-intel-2.7/rpy2/interactive
copying ./rpy/interactive/process_revents.py -> build/lib.macosx-10.12-intel-2.7/rpy2/interactive
creating build/lib.macosx-10.12-intel-2.7/rpy2/interactive/tests
copying ./rpy/interactive/tests/__init__.py -> build/lib.macosx-10.12-intel-2.7/rpy2/interactive/tests
creating build/lib.macosx-10.12-intel-2.7/rpy2/ipython
copying ./rpy/ipython/__init__.py -> build/lib.macosx-10.12-intel-2.7/rpy2/ipython
copying ./rpy/ipython/ggplot.py -> build/lib.macosx-10.12-intel-2.7/rpy2/ipython
copying ./rpy/ipython/html.py -> build/lib.macosx-10.12-intel-2.7/rpy2/ipython
copying ./rpy/ipython/rmagic.py -> build/lib.macosx-10.12-intel-2.7/rpy2/ipython
creating build/lib.macosx-10.12-intel-2.7/rpy2/ipython/tests
copying ./rpy/ipython/tests/__init__.py -> build/lib.macosx-10.12-intel-2.7/rpy2/ipython/tests
copying ./rpy/ipython/tests/test_rmagic.py -> build/lib.macosx-10.12-intel-2.7/rpy2/ipython/tests
running build_clib
building 'r_utils' library
creating build/temp.macosx-10.12-intel-2.7
creating build/temp.macosx-10.12-intel-2.7/rpy
creating build/temp.macosx-10.12-intel-2.7/rpy/rinterface
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I./rpy/rinterface -I/Library/Frameworks/R.framework/Resources/include -c ./rpy/rinterface/r_utils.c -o build/temp.macosx-10.12-intel-2.7/./rpy/rinterface/r_utils.o
./rpy/rinterface/r_utils.c:230:40: warning: implicitly declaring library function 'malloc' with type 'void *(unsigned long)' [-Wimplicit-function-declaration]
  ExternallyManagedVector *extvector = malloc(sizeof(ExternallyManagedVector));
                                       ^
./rpy/rinterface/r_utils.c:230:40: note: include the header <stdlib.h> or explicitly provide a declaration for 'malloc'
1 warning generated.
./rpy/rinterface/r_utils.c:230:40: warning: implicitly declaring library function 'malloc' with type 'void *(unsigned long)' [-Wimplicit-function-declaration]
  ExternallyManagedVector *extvector = malloc(sizeof(ExternallyManagedVector));
                                       ^
./rpy/rinterface/r_utils.c:230:40: note: include the header <stdlib.h> or explicitly provide a declaration for 'malloc'
1 warning generated.
ar rc build/temp.macosx-10.12-intel-2.7/libr_utils.a build/temp.macosx-10.12-intel-2.7/./rpy/rinterface/r_utils.o
ranlib build/temp.macosx-10.12-intel-2.7/libr_utils.a
running build_ext
R version 3.4.0 (2017-04-21) -- "You Stupid Darkness"
building 'rpy2.rinterface._rinterface' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DR_INTERFACE_PTRS=1 -DHAVE_POSIX_SIGJMP=1 -DRIF_HAS_RSIGHAND=1 -DCSTACK_DEFNS=1 -DHAS_READLINE=1 -I./rpy/rinterface -I/Library/Frameworks/R.framework/Resources/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c ./rpy/rinterface/_rinterface.c -o build/temp.macosx-10.12-intel-2.7/./rpy/rinterface/_rinterface.o
In file included from ./rpy/rinterface/_rinterface.c:98:
./rpy/rinterface/embeddedr.h:6:27: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
extern const unsigned int const RPY_R_INITIALIZED;
                          ^
./rpy/rinterface/embeddedr.h:7:27: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
extern const unsigned int const RPY_R_BUSY;
                          ^
In file included from ./rpy/rinterface/_rinterface.c:116:
./rpy/rinterface/embeddedr.c:5:20: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const unsigned int const RPY_R_INITIALIZED = 0x01;
                   ^
./rpy/rinterface/embeddedr.c:6:20: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const unsigned int const RPY_R_BUSY = 0x02;
                   ^
./rpy/rinterface/embeddedr.c:48:12: warning: unused variable 'res' [-Wunused-variable]
      SEXP res = rpy2_remove(Rf_mkString(name_buf),
           ^
In file included from ./rpy/rinterface/_rinterface.c:119:
./rpy/rinterface/sexp.c:742:13: warning: unused variable 'copy' [-Wunused-variable]
  PyObject *copy = Py_True;
            ^
In file included from ./rpy/rinterface/_rinterface.c:122:
./rpy/rinterface/sequence.c:267:30: warning: implicit conversion loses integer precision: 'long' to 'R_len_t' (aka 'int') [-Wshorten-64-to-32]
    R_len_t slice_len = ihigh-ilow;
            ~~~~~~~~~   ~~~~~^~~~~
./rpy/rinterface/sequence.c:522:30: warning: implicit conversion loses integer precision: 'long' to 'R_len_t' (aka 'int') [-Wshorten-64-to-32]
    R_len_t slice_len = ihigh-ilow;
            ~~~~~~~~~   ~~~~~^~~~~
./rpy/rinterface/_rinterface.c:347:3: warning: variable 'consolecallback' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
  default:
  ^~~~~~~
./rpy/rinterface/_rinterface.c:373:7: note: uninitialized use occurs here
  if (consolecallback == NULL) {
      ^~~~~~~~~~~~~~~
./rpy/rinterface/_rinterface.c:339:24: note: initialize the variable 'consolecallback' to silence this warning
  void *consolecallback;
                       ^
                        = NULL
./rpy/rinterface/_rinterface.c:582:9: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
  int l=strlen(input_str);
      ~ ^~~~~~~~~~~~~~~~~
./rpy/rinterface/_rinterface.c:789:9: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
  int l=strlen(path_str);
      ~ ^~~~~~~~~~~~~~~~
./rpy/rinterface/_rinterface.c:1295:28: warning: implicit conversion loses integer precision: 'const Py_ssize_t' (aka 'const long') to 'int' [-Wshorten-64-to-32]
  status = Rf_initialize_R(n_args, options);
           ~~~~~~~~~~~~~~~ ^~~~~~
./rpy/rinterface/_rinterface.c:1694:13: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
  nparams = PySequence_Length(params);
          ~ ^~~~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/abstract.h:1065:27: note: expanded from macro 'PySequence_Length'
#define PySequence_Length PySequence_Size
                          ^
In file included from ./rpy/rinterface/_rinterface.c:52:
./rpy/rinterface/_rinterface.h:203:44: warning: unused function 'PyRinterface_IsInitialized' [-Wunused-function]
  static PyRinterface_IsInitialized_RETURN PyRinterface_IsInitialized PyRinterface_IsInitialized_PROTO;
                                           ^
./rpy/rinterface/_rinterface.h:204:38: warning: unused function 'PyRinterface_FindFun' [-Wunused-function]
  static PyRinterface_FindFun_RETURN PyRinterface_FindFun PyRinterface_FindFun_PROTO;
                                     ^
In file included from ./rpy/rinterface/_rinterface.c:122:
./rpy/rinterface/sequence.c:2168:1: warning: unused function 'ComplexVectorSexp_AsSexp' [-Wunused-function]
ComplexVectorSexp_AsSexp(PyObject *pyfloat) {
^
16 warnings generated.
In file included from ./rpy/rinterface/_rinterface.c:52:
In file included from ./rpy/rinterface/_rinterface.h:8:
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:81:
/Library/Frameworks/R.framework/Resources/include/Rconfig.h:20:9: warning: 'SIZEOF_SIZE_T' macro redefined [-Wmacro-redefined]
#define SIZEOF_SIZE_T 8
        ^
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pymacconfig.h:56:17: note: previous definition is here
#        define SIZEOF_SIZE_T           4
                ^
In file included from ./rpy/rinterface/_rinterface.c:98:
./rpy/rinterface/embeddedr.h:6:27: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
extern const unsigned int const RPY_R_INITIALIZED;
                          ^
./rpy/rinterface/embeddedr.h:7:27: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
extern const unsigned int const RPY_R_BUSY;
                          ^
In file included from ./rpy/rinterface/_rinterface.c:116:
./rpy/rinterface/embeddedr.c:5:20: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const unsigned int const RPY_R_INITIALIZED = 0x01;
                   ^
./rpy/rinterface/embeddedr.c:6:20: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
const unsigned int const RPY_R_BUSY = 0x02;
                   ^
./rpy/rinterface/embeddedr.c:48:12: warning: unused variable 'res' [-Wunused-variable]
      SEXP res = rpy2_remove(Rf_mkString(name_buf),
           ^
In file included from ./rpy/rinterface/_rinterface.c:119:
./rpy/rinterface/sexp.c:742:13: warning: unused variable 'copy' [-Wunused-variable]
  PyObject *copy = Py_True;
            ^
./rpy/rinterface/_rinterface.c:347:3: warning: variable 'consolecallback' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
  default:
  ^~~~~~~
./rpy/rinterface/_rinterface.c:373:7: note: uninitialized use occurs here
  if (consolecallback == NULL) {
      ^~~~~~~~~~~~~~~
./rpy/rinterface/_rinterface.c:339:24: note: initialize the variable 'consolecallback' to silence this warning
  void *consolecallback;
                       ^
                        = NULL
In file included from ./rpy/rinterface/_rinterface.c:52:
./rpy/rinterface/_rinterface.h:203:44: warning: unused function 'PyRinterface_IsInitialized' [-Wunused-function]
  static PyRinterface_IsInitialized_RETURN PyRinterface_IsInitialized PyRinterface_IsInitialized_PROTO;
                                           ^
./rpy/rinterface/_rinterface.h:204:38: warning: unused function 'PyRinterface_FindFun' [-Wunused-function]
  static PyRinterface_FindFun_RETURN PyRinterface_FindFun PyRinterface_FindFun_PROTO;
                                     ^
In file included from ./rpy/rinterface/_rinterface.c:122:
./rpy/rinterface/sequence.c:2168:1: warning: unused function 'ComplexVectorSexp_AsSexp' [-Wunused-function]
ComplexVectorSexp_AsSexp(PyObject *pyfloat) {
^
11 warnings generated.
cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.12-intel-2.7/./rpy/rinterface/_rinterface.o -L/usr/local/lib -Lbuild/temp.macosx-10.12-intel-2.7 -L/usr/local/lib -lpcre -llzma -lbz2 -lz -licucore -lm -liconv -lr_utils -o build/lib.macosx-10.12-intel-2.7/rpy2/rinterface/_rinterface.so -fopenmp -F/Library/Frameworks/R.framework/.. -framework R
clang: error: unsupported option '-fopenmp'
clang: error: unsupported option '-fopenmp'
error: command 'cc' failed with exit status 1

----------------------------------------

命令&#34; / usr / bin / python -u -c&#34;导入setuptools,tokenize; 文件 =&#39; / private / tmp / pip-build-0H8VbG /rpy2/setup.py';f=getattr(tokenize,' open&#39;,open)( file ); code = f.read()。replace(&# 39; \ r \ n&#39;,&#39; \ n&#39;); f.close(); exec(编译(代码,文件,&#39; exec&#39; ))&#34; install --record /tmp/pip-umxGfs-record/install-record.txt --single-version-external-managed --compile&#34;在/ private / tmp / pip-build-0H8VbG / rpy2 /

中出现错误代码1失败

1 个答案:

答案 0 :(得分:1)

在尝试解决类似问题时,我在RPy2 Bitbucket上遇到了this problem thread。显然,最新的R(3.4.0&#34; Single Candle&#34;)是使用Clang 4.0.0的-fopenmp标志构建的,现在不是由Apple提供的。如果你可以使用R 3.3.3,那么这可以作为一种解决方法。或者,您可以尝试修改setup.py以通过在第272行之后添加以下内容来删除-fopenmp标记:

if "-fopenmp" in unknown:
    unknown.remove("-fopenmp")

如果两者都不起作用,您可以随时强制brew使用gcc使用以下命令安装它:

env CC=/usr/local/Cellar/gcc/7.2.0/bin/gcc-7 pip install rpy2

或者如果你尝试其中一种解决方案并得到如下错误:

ld: in '/usr/local/opt/llvm/lib/libunwind.dylib', file was built for x86_64 which is not the architecture being linked (i386): /usr/local/opt/llvm/lib/libunwind.dylib for architecture i386
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/local/opt/llvm/bin/clang' failed with exit status 1

您可以尝试使用以下命令进行安装:

env ARCHFLAGS="-arch x86_64" pip install rpy2

确保架构正确。或者将它们结合起来:

env ARCHFLAGS="-arch x86_64" CC=/usr/local/Cellar/gcc/7.2.0/bin/gcc-7 pip install rpy2

真的,这似乎是一个弗兰肯斯坦问题。不同的解决方案适用于不同的人 - 以上是最常见的解决方案。它不是很快就会有一个简单的解决方案,因为它似乎是R的问题。