【问题标题】:Can not install RPy2无法安装 RPy2
【发布时间】:2018-07-27 07:01:26
【问题描述】:

在尝试安装 RPy2 时,我得到以下输出。我究竟做错了什么?哪些前提条件不满足?

    username@usernameVB:~$ pip install rpy2
Collecting rpy2
  Using cached https://files.pythonhosted.org/packages/f1/98/c7652cc9d7fc0afce74d2c30a52b9c9ac391713a63d037e4ab8feb56c530/rpy2-2.9.4.tar.gz
Requirement already satisfied: six in ./miniconda3/lib/python3.6/site-packages (from rpy2) (1.11.0)
Requirement already satisfied: jinja2 in ./miniconda3/lib/python3.6/site-packages (from rpy2) (2.10)
Requirement already satisfied: MarkupSafe>=0.23 in ./miniconda3/lib/python3.6/site-packages (from jinja2->rpy2) (1.0)
Building wheels for collected packages: rpy2
  Running setup.py bdist_wheel for rpy2 ... error
  Complete output from command /home/username/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-9d74vjq7/rpy2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-e0iufv00 --python-tag cp36:
  R version 3.5.1 (2018-07-02) -- "Feather Spray"
  /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', 'icuuc', 'icui18n']
          extra_link_args = ['-Wl,--export-dynamic', '-fopenmp', '-Wl,-Bsymbolic-functions', '-Wl,-z,relro']

  running bdist_wheel
  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/situation.py -> build/lib.linux-x86_64-3.6/rpy2
  copying ./rpy/__init__.py -> build/lib.linux-x86_64-3.6/rpy2
  copying ./rpy/tests.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/__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
  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
  creating 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/__init__.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_EmbeddedR.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_SexpVectorNumeric.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_Sexp.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
  copying ./rpy/rinterface/tests/test_SexpVector.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
  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/__init__.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/language.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/functions.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/packages_utils.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/robject.py -> build/lib.linux-x86_64-3.6/rpy2/robjects
  copying ./rpy/robjects/numpy2ri.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/testDataFrame.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/__init__.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/testFormula.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/testRObject.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
  copying ./rpy/robjects/tests/testArray.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/testLanguage.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/testPandasConversions.py -> 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/testRobjects.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/ggplot2.py -> 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/__init__.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/dbplyr.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/test_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
  creating 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/__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_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/process_revents.py -> build/lib.linux-x86_64-3.6/rpy2/interactive
  copying ./rpy/interactive/packages.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/ggplot.py -> 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/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
  gcc -pthread -B /home/username/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -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:1040:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
   const char *R_curErrorBuf();
   ^~~~~
  /usr/share/R/include/Rinternals.h:1115:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
   void R_init_altrep();
   ^~~~
  /usr/share/R/include/Rinternals.h:1128:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
   SEXP R_MakeUnwindCont();
   ^~~~
  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.5.1 (2018-07-02) -- "Feather Spray"
  building 'rpy2.rinterface._rinterface' extension
  gcc -pthread -B /home/username/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -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/home/username/miniconda3/include/python3.6m -c ./rpy/rinterface/_rinterface.c -o build/temp.linux-x86_64-3.6/./rpy/rinterface/_rinterface.o
  In file included from /usr/share/R/include/R.h:87:0,
                   from ./rpy/rinterface/_rinterface.h:8,
                   from ./rpy/rinterface/_rinterface.c:52:
  /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 ./rpy/rinterface/_rinterface.h:9,
                   from ./rpy/rinterface/_rinterface.c:52:
  /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 ./rpy/rinterface/_rinterface.h:9:0,
                   from ./rpy/rinterface/_rinterface.c:52:
  /usr/share/R/include/Rinternals.h:1040:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
   const char *R_curErrorBuf();
   ^~~~~
  /usr/share/R/include/Rinternals.h:1115:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
   void R_init_altrep();
   ^~~~
  /usr/share/R/include/Rinternals.h:1128:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
   SEXP R_MakeUnwindCont();
   ^~~~
  In file included from ./rpy/rinterface/_rinterface.c:64:0:
  /usr/share/R/include/Rinterface.h:157:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
   extern void (*ptr_R_ProcessEvents)();
   ^~~~~~
  ./rpy/rinterface/_rinterface.c:80:10: fatal error: readline/readline.h: No such file or directory
   #include <readline/readline.h>
            ^~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  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 /home/username/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-9d74vjq7/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-record-hf8g7yqq/install-record.txt --single-version-externally-managed --compile:
    R version 3.5.1 (2018-07-02) -- "Feather Spray"
    /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', 'icuuc', 'icui18n']
            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/situation.py -> build/lib.linux-x86_64-3.6/rpy2
    copying ./rpy/__init__.py -> build/lib.linux-x86_64-3.6/rpy2
    copying ./rpy/tests.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/__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
    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
    creating 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/__init__.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_EmbeddedR.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_SexpVectorNumeric.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_Sexp.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
    copying ./rpy/rinterface/tests/test_SexpVector.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
    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/__init__.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/language.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/functions.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/packages_utils.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/robject.py -> build/lib.linux-x86_64-3.6/rpy2/robjects
    copying ./rpy/robjects/numpy2ri.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/testDataFrame.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/__init__.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/testFormula.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/testRObject.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
    copying ./rpy/robjects/tests/testArray.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/testLanguage.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/testPandasConversions.py -> 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/testRobjects.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/ggplot2.py -> 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/__init__.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/dbplyr.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/test_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
    creating 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/__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_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/process_revents.py -> build/lib.linux-x86_64-3.6/rpy2/interactive
    copying ./rpy/interactive/packages.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/ggplot.py -> 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/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
    gcc -pthread -B /home/username/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -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:1040:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
     const char *R_curErrorBuf();
     ^~~~~
    /usr/share/R/include/Rinternals.h:1115:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
     void R_init_altrep();
     ^~~~
    /usr/share/R/include/Rinternals.h:1128:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
     SEXP R_MakeUnwindCont();
     ^~~~
    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.5.1 (2018-07-02) -- "Feather Spray"
    building 'rpy2.rinterface._rinterface' extension
    gcc -pthread -B /home/username/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -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/home/username/miniconda3/include/python3.6m -c ./rpy/rinterface/_rinterface.c -o build/temp.linux-x86_64-3.6/./rpy/rinterface/_rinterface.o
    In file included from /usr/share/R/include/R.h:87:0,
                     from ./rpy/rinterface/_rinterface.h:8,
                     from ./rpy/rinterface/_rinterface.c:52:
    /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 ./rpy/rinterface/_rinterface.h:9,
                     from ./rpy/rinterface/_rinterface.c:52:
    /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 ./rpy/rinterface/_rinterface.h:9:0,
                     from ./rpy/rinterface/_rinterface.c:52:
    /usr/share/R/include/Rinternals.h:1040:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
     const char *R_curErrorBuf();
     ^~~~~
    /usr/share/R/include/Rinternals.h:1115:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
     void R_init_altrep();
     ^~~~
    /usr/share/R/include/Rinternals.h:1128:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
     SEXP R_MakeUnwindCont();
     ^~~~
    In file included from ./rpy/rinterface/_rinterface.c:64:0:
    /usr/share/R/include/Rinterface.h:157:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
     extern void (*ptr_R_ProcessEvents)();
     ^~~~~~
    ./rpy/rinterface/_rinterface.c:80:10: fatal error: readline/readline.h: No such file or directory
     #include <readline/readline.h>
              ^~~~~~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/home/username/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-9d74vjq7/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-record-hf8g7yqq/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-9d74vjq7/rpy2/

我的 R 安装是否存在问题(它是 Ubuntu 上安装的默认 R)?

我需要添加“更多详细信息”,因为我的帖子似乎只包含代码,因此无法提交。所以这里有更多细节:等等等等,细节1,细节2,细节3,......

【问题讨论】:

标签: python r rpy2


【解决方案1】:

您需要安装库 readline 及其标题。

提示接近终端输出的末尾:

./rpy/rinterface/_rinterface.c:80:10: fatal error: readline/readline.h: No such file or directory
     #include <readline/readline.h>
              ^~~~~~~~~~~~~~~~~~~~~
    compilation terminated.

【讨论】:

  • 我已经安装了所有这些:username@usernameVB:~$ dpkg -S readline.h libreadline-dev:amd64: /usr/include/readline/readline.h nodejs-doc: /usr/share /doc/nodejs-doc/api/readline.html username@usernameVB:~$ sudo apt-get install libreadline7 libreadline-dev Reading package lists... Done Building dependency tree Reading state information... Done libreadline-dev 已经是最新版本(7.0-3)。 libreadline7 已经是最新版本(7.0-3)。 0 个已升级,0 个新安装,0 个要移除,9 个未升级。
  • 但我仍然收到错误:./rpy/rinterface/_rinterface.c:80:10: 致命错误:readline/readline.h: 没有这样的文件或目录#include ^~~~~~~~~~~~~~~~~~~~~ 编译终止。错误:命令 'gcc' 失败,退出状态为 1 ---------------------------------------- - rpy2 的构建轮失败
  • 问题可能与conda有关。
猜你喜欢
  • 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
相关资源
最近更新 更多