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

I am trying to install the rpy2 package. When I try pip install rpy2

I get the following error message.

Python 2.7.13

pip 9.0.1 from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (python 2.7)

Mac OS X 10.12.5

Collecting rpy2
  Using cached rpy2-2.8.6.tar.gz
Requirement already satisfied: six in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from rpy2)
Requirement already satisfied: singledispatch in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from rpy2)
Installing collected packages: rpy2
  Running setup.py install for rpy2 ... error
    Complete output from command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/var/folders/1x/p2n9lxmj7wxgkftf4b12g3gr0000gn/T/pip-build-aCVavk/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/1x/p2n9lxmj7wxgkftf4b12g3gr0000gn/T/pip-MY5Bw0-record/install-record.txt --single-version-externally-managed --compile:
    R version 3.4.0 (2017-04-21) -- "You Stupid Darkness"
    /Library/Frameworks/R.framework/Resources/bin/R CMD config --ldflags
    /Library/Frameworks/R.framework/Resources/bin/R CMD config --cppflags

        Compilation parameters for rpy2 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.6-intel-2.7
    creating build/lib.macosx-10.6-intel-2.7/rpy2
    copying ./rpy/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2
    copying ./rpy/rpy_classic.py -> build/lib.macosx-10.6-intel-2.7/rpy2
    copying ./rpy/tests.py -> build/lib.macosx-10.6-intel-2.7/rpy2
    copying ./rpy/tests_rpy_classic.py -> build/lib.macosx-10.6-intel-2.7/rpy2
    creating build/lib.macosx-10.6-intel-2.7/rpy2/rlike
    copying ./rpy/rlike/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rlike
    copying ./rpy/rlike/container.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rlike
    copying ./rpy/rlike/functional.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rlike
    copying ./rpy/rlike/indexing.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rlike
    creating build/lib.macosx-10.6-intel-2.7/rpy2/rlike/tests
    copying ./rpy/rlike/tests/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rlike/tests
    copying ./rpy/rlike/tests/test_container.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rlike/tests
    copying ./rpy/rlike/tests/test_functional.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rlike/tests
    copying ./rpy/rlike/tests/test_indexing.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rlike/tests
    creating build/lib.macosx-10.6-intel-2.7/rpy2/rinterface
    copying ./rpy/rinterface/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface
    creating build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_Device.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_EmbeddedR.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_Sexp.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_SexpClosure.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_SexpEnvironment.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_SexpExtPtr.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_SexpSymbol.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_SexpVector.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    copying ./rpy/rinterface/tests/test_SexpVectorNumeric.py -> build/lib.macosx-10.6-intel-2.7/rpy2/rinterface/tests
    creating build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/constants.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/conversion.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/environments.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/functions.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/help.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/language.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/methods.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/numpy2ri.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/packages.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/packages_utils.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/pandas2ri.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/robject.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    copying ./rpy/robjects/vectors.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects
    creating build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testArray.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testDataFrame.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testEnvironment.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testFormula.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testFunction.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testHelp.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testLanguage.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testMethods.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testNumpyConversions.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testPackages.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testPandasConversions.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testRObject.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testRobjects.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    copying ./rpy/robjects/tests/testVector.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/tests
    creating build/lib.macosx-10.6-intel-2.7/rpy2/robjects/lib
    copying ./rpy/robjects/lib/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/lib
    copying ./rpy/robjects/lib/dplyr.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/lib
    copying ./rpy/robjects/lib/ggplot2.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/lib
    copying ./rpy/robjects/lib/grdevices.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/lib
    copying ./rpy/robjects/lib/grid.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/lib
    copying ./rpy/robjects/lib/tidyr.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/lib
    creating build/lib.macosx-10.6-intel-2.7/rpy2/robjects/lib/tests
    copying ./rpy/robjects/lib/tests/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/lib/tests
    copying ./rpy/robjects/lib/tests/test_dplyr.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/lib/tests
    copying ./rpy/robjects/lib/tests/test_ggplot2.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/lib/tests
    copying ./rpy/robjects/lib/tests/test_grdevices.py -> build/lib.macosx-10.6-intel-2.7/rpy2/robjects/lib/tests
    creating build/lib.macosx-10.6-intel-2.7/rpy2/interactive
    copying ./rpy/interactive/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/interactive
    copying ./rpy/interactive/packages.py -> build/lib.macosx-10.6-intel-2.7/rpy2/interactive
    copying ./rpy/interactive/process_revents.py -> build/lib.macosx-10.6-intel-2.7/rpy2/interactive
    creating build/lib.macosx-10.6-intel-2.7/rpy2/interactive/tests
    copying ./rpy/interactive/tests/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/interactive/tests
    creating build/lib.macosx-10.6-intel-2.7/rpy2/ipython
    copying ./rpy/ipython/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/ipython
    copying ./rpy/ipython/ggplot.py -> build/lib.macosx-10.6-intel-2.7/rpy2/ipython
    copying ./rpy/ipython/html.py -> build/lib.macosx-10.6-intel-2.7/rpy2/ipython
    copying ./rpy/ipython/rmagic.py -> build/lib.macosx-10.6-intel-2.7/rpy2/ipython
    creating build/lib.macosx-10.6-intel-2.7/rpy2/ipython/tests
    copying ./rpy/ipython/tests/__init__.py -> build/lib.macosx-10.6-intel-2.7/rpy2/ipython/tests
    copying ./rpy/ipython/tests/test_rmagic.py -> build/lib.macosx-10.6-intel-2.7/rpy2/ipython/tests
    running build_clib
    building 'r_utils' library
    creating build/temp.macosx-10.6-intel-2.7
    creating build/temp.macosx-10.6-intel-2.7/rpy
    creating build/temp.macosx-10.6-intel-2.7/rpy/rinterface
    /usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I./rpy/rinterface -I/Library/Frameworks/R.framework/Resources/include -c ./rpy/rinterface/r_utils.c -o build/temp.macosx-10.6-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.6-intel-2.7/libr_utils.a build/temp.macosx-10.6-intel-2.7/./rpy/rinterface/r_utils.o
    ranlib build/temp.macosx-10.6-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
    /usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -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/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c ./rpy/rinterface/_rinterface.c -o build/temp.macosx-10.6-intel-2.7/./rpy/rinterface/_rinterface.o
    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
            ^
    /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:2173:1: warning: unused function 'ComplexVectorSexp_AsSexp' [-Wunused-function]
    ComplexVectorSexp_AsSexp(PyObject *pyfloat) {
    ^
    11 warnings generated.
    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:2173:1: warning: unused function 'ComplexVectorSexp_AsSexp' [-Wunused-function]
    ComplexVectorSexp_AsSexp(PyObject *pyfloat) {
    ^
    10 warnings generated.
    /usr/bin/clang -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-2.7/./rpy/rinterface/_rinterface.o -L/usr/local/lib -Lbuild/temp.macosx-10.6-intel-2.7 -L/usr/local/lib -lpcre -llzma -lbz2 -lz -licucore -lm -liconv -lr_utils -o build/lib.macosx-10.6-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 '/usr/bin/clang' failed with exit status 1

    ----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/var/folders/1x/p2n9lxmj7wxgkftf4b12g3gr0000gn/T/pip-build-aCVavk/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/1x/p2n9lxmj7wxgkftf4b12g3gr0000gn/T/pip-MY5Bw0-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/1x/p2n9lxmj7wxgkftf4b12g3gr0000gn/T/pip-build-aCVavk/rpy2/

      

In case, my clang version is

clang --version
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

      

Can anyone solve this problem?

thank

+3


source to share





All Articles