在Windows10上安装Rpy2时出现问题

时间:2019-08-12 15:29:09

标签: python r anaconda rpy2

在尝试安装rpy2时遇到以下错误。我不确定这里发生了什么。关于如何解决此问题的任何建议?我查看了有关该主题的几篇文章,但似乎都没有类似的错误消息。顺便说一句,我在Windows10上使用python 3.6.1和R 3.5.2

PS C:\WINDOWS\system32> pip install rpy2
Collecting rpy2
  Using cached https://files.pythonhosted.org/packages/c7/43/401afad8556bf92b08bd7d422cacac614b0e8dd2bce31848318bbcb18f48/rpy2-3.0.5.tar.gz
    ERROR: Command errored out with exit status 1:
     command: 'c:\programdata\anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\10453\\AppData\\Local\\Temp\\pip-install-7qvkng0f\\rpy2\\setup.py'"'"'; __file__='"'"'C:\\Users\\10453\\AppData\\Local\\Temp\\pip-install-7qvkng0f\\rpy2\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: C:\Users\10453\AppData\Local\Temp\pip-install-7qvkng0f\rpy2\
    Complete output (51 lines):
    Traceback (most recent call last):
      File "c:\programdata\anaconda3\lib\site-packages\cffi\cparser.py", line 269, in _parse
        ast = _get_parser().parse(csource)
      File "c:\programdata\anaconda3\lib\site-packages\pycparser\c_parser.py", line 151, in parse
        debug=debuglevel)
      File "c:\programdata\anaconda3\lib\site-packages\pycparser\ply\yacc.py", line 331, in parse
        return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
      File "c:\programdata\anaconda3\lib\site-packages\pycparser\ply\yacc.py", line 1181, in parseopt_notrack
        tok = call_errorfunc(self.errorfunc, errtoken, self)
      File "c:\programdata\anaconda3\lib\site-packages\pycparser\ply\yacc.py", line 193, in call_errorfunc
        r = errorfunc(token)
      File "c:\programdata\anaconda3\lib\site-packages\pycparser\c_parser.py", line 1721, in p_error
        column=self.clex.find_tok_column(p)))
      File "c:\programdata\anaconda3\lib\site-packages\pycparser\plyparser.py", line 55, in _parse_error
        raise ParseError("%s: %s" % (coord, msg))
    pycparser.plyparser.ParseError: :42:5: before: blah1

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\10453\AppData\Local\Temp\pip-install-7qvkng0f\rpy2\setup.py", line 184, in <module>
        'rpy2': ['doc/source/rpy2_logo.png', ]}
      File "c:\programdata\anaconda3\lib\distutils\core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "c:\programdata\anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\setuptools\dist.py", line 318, in __init__
      File "c:\programdata\anaconda3\lib\distutils\dist.py", line 281, in __init__
        self.finalize_options()
      File "c:\programdata\anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\setuptools\dist.py", line 375, in finalize_options
      File "c:\programdata\anaconda3\lib\site-packages\cffi\setuptools_ext.py", line 188, in cffi_modules
        add_cffi_module(dist, cffi_module)
      File "c:\programdata\anaconda3\lib\site-packages\cffi\setuptools_ext.py", line 49, in add_cffi_module
        execfile(build_file_name, mod_vars)
      File "c:\programdata\anaconda3\lib\site-packages\cffi\setuptools_ext.py", line 25, in execfile
        exec(code, glob, glob)
      File "rpy/_rinterface_cffi_build.py", line 546, in <module>
        """ if os.name == 'nt' else ''
      File "c:\programdata\anaconda3\lib\site-packages\cffi\api.py", line 106, in cdef
        self._cdef(csource, override=override, packed=packed)
      File "c:\programdata\anaconda3\lib\site-packages\cffi\api.py", line 120, in _cdef
        self._parser.parse(csource, override=override, **options)
      File "c:\programdata\anaconda3\lib\site-packages\cffi\cparser.py", line 308, in parse
        self._internal_parse(csource)
      File "c:\programdata\anaconda3\lib\site-packages\cffi\cparser.py", line 313, in _internal_parse
        ast, macros, csource = self._parse(csource)
      File "c:\programdata\anaconda3\lib\site-packages\cffi\cparser.py", line 271, in _parse
        self.convert_pycparser_error(e, csource)
      File "c:\programdata\anaconda3\lib\site-packages\cffi\cparser.py", line 300, in convert_pycparser_error
        raise CDefError(msg)
    cffi.error.CDefError: cannot parse "blah1 ReadConsole;"
    :42:5: before: blah1
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

0 个答案:

没有答案