error pip3 install rpy2

Issue #433 invalid
buchhola
created an issue

Using python3.6 I have the following issue: Thank you in advance.

alex@alex-HP-EliteBook-Folio-1040-G2:~$ sudo pip3 install rpy2

Collecting rpy2 Downloading rpy2-2.9.0.tar.gz (193kB) 100% |████████████████████████████████| 194kB 2.3MB/s Requirement already satisfied: six in /usr/lib/python3/dist-packages (from rpy2) Installing collected packages: rpy2 Running setup.py install for rpy2 ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-7lrpdri9/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 /tmp/pip-aj_h056o-record/install-record.txt --single-version-externally-managed --compile: R version 3.4.1 (2017-06-30) -- "Single Candle" /usr/lib/R/bin/R CMD config --ldflags /usr/lib/R/bin/R CMD config --cppflags

    Compilation parameters for rpy2's C components:
        include_dirs    = ['/usr/share/R/include']
        library_dirs    = ['/usr/lib/R/lib']
        libraries       = ['R', 'pcre', 'lzma', 'bz2', 'z', 'rt', 'dl', 'm']
        extra_link_args = ['-Wl,--export-dynamic', '-fopenmp', '-Wl,-Bsymbolic-functions', '-Wl,-z,relro']

running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/rpy2
copying ./rpy/tests.py -> build/lib.linux-x86_64-3.6/rpy2
copying ./rpy/__init__.py -> build/lib.linux-x86_64-3.6/rpy2
copying ./rpy/situation.py -> build/lib.linux-x86_64-3.6/rpy2
copying ./rpy/tests_rpy_classic.py -> build/lib.linux-x86_64-3.6/rpy2
copying ./rpy/rpy_classic.py -> build/lib.linux-x86_64-3.6/rpy2
creating build/lib.linux-x86_64-3.6/rpy2/rlike
copying ./rpy/rlike/container.py -> build/lib.linux-x86_64-3.6/rpy2/rlike
copying ./rpy/rlike/indexing.py -> build/lib.linux-x86_64-3.6/rpy2/rlike
copying ./rpy/rlike/__init__.py -> build/lib.linux-x86_64-3.6/rpy2/rlike
copying ./rpy/rlike/functional.py -> build/lib.linux-x86_64-3.6/rpy2/rlike
creating build/lib.linux-x86_64-3.6/rpy2/rlike/tests
copying ./rpy/rlike/tests/__init__.py -> build/lib.linux-x86_64-3.6/rpy2/rlike/tests
copying ./rpy/rlike/tests/test_functional.py -> build/lib.linux-x86_64-3.6/rpy2/rlike/tests
copying ./rpy/rlike/tests/test_container.py -> build/lib.linux-x86_64-3.6/rpy2/rlike/tests
copying ./rpy/rlike/tests/test_indexing.py -> build/lib.linux-x86_64-3.6/rpy2/rlike/tests
creating build/lib.linux-x86_64-3.6/rpy2/rinterface
copying ./rpy/rinterface/__init__.py -> build/lib.linux-x86_64-3.6/rpy2/rinterface
creating build/lib.linux-x86_64-3.6/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_SexpVector.py -> build/lib.linux-x86_64-3.6/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/__init__.py -> build/lib.linux-x86_64-3.6/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_SexpEnvironment.py -> build/lib.linux-x86_64-3.6/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_Sexp.py -> build/lib.linux-x86_64-3.6/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_SexpVectorNumeric.py -> build/lib.linux-x86_64-3.6/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_SexpClosure.py -> build/lib.linux-x86_64-3.6/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_SexpSymbol.py -> build/lib.linux-x86_64-3.6/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_EmbeddedR.py -> build/lib.linux-x86_64-3.6/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_Device.py -> build/lib.linux-x86_64-3.6/rpy2/rinterface/tests
copying ./rpy/rinterface/tests/test_SexpExtPtr.py -> build/lib.linux-x86_64-3.6/rpy2/rinterface/tests
creating build/lib.linux-x86_64-3.6/rpy2/robjects
copying ./rpy/robjects/help.py -> build/lib.linux-x86_64-3.6/rpy2/robjects
copying ./rpy/robjects/environments.py -> build/lib.linux-x86_64-3.6/rpy2/robjects
copying ./rpy/robjects/functions.py -> build/lib.linux-x86_64-3.6/rpy2/robjects
copying ./rpy/robjects/methods.py -> build/lib.linux-x86_64-3.6/rpy2/robjects
copying ./rpy/robjects/__init__.py -> build/lib.linux-x86_64-3.6/rpy2/robjects
copying ./rpy/robjects/packages.py -> build/lib.linux-x86_64-3.6/rpy2/robjects
copying ./rpy/robjects/constants.py -> build/lib.linux-x86_64-3.6/rpy2/robjects
copying ./rpy/robjects/pandas2ri.py -> build/lib.linux-x86_64-3.6/rpy2/robjects
copying ./rpy/robjects/vectors.py -> build/lib.linux-x86_64-3.6/rpy2/robjects
copying ./rpy/robjects/conversion.py -> build/lib.linux-x86_64-3.6/rpy2/robjects
copying ./rpy/robjects/numpy2ri.py -> build/lib.linux-x86_64-3.6/rpy2/robjects
copying ./rpy/robjects/language.py -> build/lib.linux-x86_64-3.6/rpy2/robjects
copying ./rpy/robjects/packages_utils.py -> build/lib.linux-x86_64-3.6/rpy2/robjects
copying ./rpy/robjects/robject.py -> build/lib.linux-x86_64-3.6/rpy2/robjects
creating build/lib.linux-x86_64-3.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testHelp.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testRObject.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testFunction.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testArray.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/__init__.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testPandasConversions.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testVector.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testDataFrame.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testNumpyConversions.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testMethods.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testRobjects.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testPackages.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testLanguage.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testFormula.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/tests
copying ./rpy/robjects/tests/testEnvironment.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/tests
creating build/lib.linux-x86_64-3.6/rpy2/robjects/lib
copying ./rpy/robjects/lib/tidyr.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/lib
copying ./rpy/robjects/lib/grid.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/lib
copying ./rpy/robjects/lib/__init__.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/lib
copying ./rpy/robjects/lib/dplyr.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/lib
copying ./rpy/robjects/lib/grdevices.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/lib
copying ./rpy/robjects/lib/test_dplyr.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/lib
copying ./rpy/robjects/lib/dbplyr.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/lib
copying ./rpy/robjects/lib/ggplot2.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/lib
creating build/lib.linux-x86_64-3.6/rpy2/robjects/lib/tests
copying ./rpy/robjects/lib/tests/__init__.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/lib/tests
copying ./rpy/robjects/lib/tests/test_dplyr.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/lib/tests
copying ./rpy/robjects/lib/tests/test_grdevices.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/lib/tests
copying ./rpy/robjects/lib/tests/test_ggplot2.py -> build/lib.linux-x86_64-3.6/rpy2/robjects/lib/tests
creating build/lib.linux-x86_64-3.6/rpy2/interactive
copying ./rpy/interactive/__init__.py -> build/lib.linux-x86_64-3.6/rpy2/interactive
copying ./rpy/interactive/packages.py -> build/lib.linux-x86_64-3.6/rpy2/interactive
copying ./rpy/interactive/process_revents.py -> build/lib.linux-x86_64-3.6/rpy2/interactive
creating build/lib.linux-x86_64-3.6/rpy2/interactive/tests
copying ./rpy/interactive/tests/__init__.py -> build/lib.linux-x86_64-3.6/rpy2/interactive/tests
creating build/lib.linux-x86_64-3.6/rpy2/ipython
copying ./rpy/ipython/html.py -> build/lib.linux-x86_64-3.6/rpy2/ipython
copying ./rpy/ipython/__init__.py -> build/lib.linux-x86_64-3.6/rpy2/ipython
copying ./rpy/ipython/ggplot.py -> build/lib.linux-x86_64-3.6/rpy2/ipython
copying ./rpy/ipython/rmagic.py -> build/lib.linux-x86_64-3.6/rpy2/ipython
creating build/lib.linux-x86_64-3.6/rpy2/ipython/tests
copying ./rpy/ipython/tests/__init__.py -> build/lib.linux-x86_64-3.6/rpy2/ipython/tests
copying ./rpy/ipython/tests/test_rmagic.py -> build/lib.linux-x86_64-3.6/rpy2/ipython/tests
running build_clib
building 'r_utils' library
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/rpy
creating build/temp.linux-x86_64-3.6/rpy/rinterface
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I./rpy/rinterface -I/usr/share/R/include -c ./rpy/rinterface/r_utils.c -o build/temp.linux-x86_64-3.6/./rpy/rinterface/r_utils.o
In file included from /usr/share/R/include/Rdefines.h:36:0,
                 from ./rpy/rinterface/r_utils.c:24:
/usr/share/R/include/R_ext/Memory.h:48:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
 int R_gc_running();
 ^
In file included from /usr/share/R/include/Rinternals.h:51:0,
                 from /usr/share/R/include/Rdefines.h:40,
                 from ./rpy/rinterface/r_utils.c:24:
/usr/share/R/include/R_ext/Rdynload.h:38:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
 typedef void * (*DL_FUNC)();
 ^
In file included from /usr/share/R/include/Rdefines.h:40:0,
                 from ./rpy/rinterface/r_utils.c:24:
/usr/share/R/include/Rinternals.h:919:1: warning: function declaration isn’t a prototype [-Wstrict-prototypes]
 const char *R_curErrorBuf();
 ^
x86_64-linux-gnu-ar rc build/temp.linux-x86_64-3.6/libr_utils.a build/temp.linux-x86_64-3.6/./rpy/rinterface/r_utils.o
running build_ext
R version 3.4.1 (2017-06-30) -- "Single Candle"
building 'rpy2.rinterface._rinterface' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DR_INTERFACE_PTRS=1 -DHAVE_POSIX_SIGJMP=1 -DRIF_HAS_RSIGHAND=1 -DCSTACK_DEFNS=1 -DHAS_READLINE=1 -I./rpy/rinterface -I/usr/share/R/include -I/usr/include/python3.6m -c ./rpy/rinterface/_rinterface.c -o build/temp.linux-x86_64-3.6/./rpy/rinterface/_rinterface.o
./rpy/rinterface/_rinterface.c:49:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

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

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-7lrpdri9/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 /tmp/pip-aj_h056o-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-7lrpdri9/rpy2/

Comments (1)

  1. Laurent Gautier

    Hi, The issue tracker is meant for issues with rpy2 as in "bug in rpy2" or "missing features in rpy2". Users questions are better answer on forums or StackOverflow.

    Here the answer is obtained last part of the install log: Python.h is not present on your system.

  2. Log in to comment