【问题标题】:Rpy2 import rpy2.robjects as robjects failsRpy2 import rpy2.robjects as robjects 失败
【发布时间】:2019-09-16 16:39:46
【问题描述】:

我已经通过 pip install rpy2 安装了 rpy2。在 Jupyter 笔记本中之后,导入工作正常:

import rpy2
print(rpy2.__version__)

返回3.1.0。 但是,当我输入 import rpy2.robjects as robjects 时,我收到以下错误:

ValueError: The system "%s" is not supported.

有人知道这个错误来自哪里以及如何解决吗?

【问题讨论】:

    标签: rpy2


    【解决方案1】:

    我遇到了完全相同的问题。

    我卸载了该软件包并使用 conda 重新安装了它(因为我通过 Anaconda 使用 Jupyter notebook):

    conda install rpy2
    

    这样做效果很好。

    安装的版本是 2.9.4。我认为 3.1.0 版本可能存在问题。

    【讨论】:

      【解决方案2】:

      我也有类似的问题。我之前使用pip3 install rpy2 安装了 rpy2 2.9.5,它运行良好。但是,今天我尝试使用pip3 install --upgrade rpy2 更新它并收到以下错误:

      Collecting rpy2
        Using cached https://files.pythonhosted.org/packages/62/bc/d43df0d9e96a38985a97d1cbdb5722e10cd8fa0da45686972f0b8fd18a67/rpy2-3.2.4.tar.gz
          Complete output from command python setup.py egg_info:
          Traceback (most recent call last):
            File "<string>", line 1, in <module>
            File "/tmp/pip-build-irk23ljv/rpy2/setup.py", line 21, in <module>
              from rpy2 import situation
            File "/tmp/pip-build-irk23ljv/rpy2/rpy2/situation.py", line 98
              raise ValueError(f'The system {system} is currently not supported.')
                                                                                ^
          SyntaxError: invalid syntax
      
          ----------------------------------------
      Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-irk23ljv/rpy2/
      

      我不能只坚持旧版本,因为我实际上想要做的是安装另一个 Python 包,该包将 rpy2 列为依赖项。安装失败并显示相同的错误消息。

      关于这个主题的任何更新?

      编辑

      看起来这可能是与 Python 3.5 的兼容性问题——请参阅https://bitbucket.org/rpy2/rpy2/issues/580/installing-rpy2-on-travis-with-pip。我刚刚在这里打开了一个问题:https://github.com/rpy2/rpy2/issues/356

      【讨论】:

        猜你喜欢
        • 2021-09-05
        • 2021-11-01
        • 2014-09-24
        • 2020-02-12
        • 2017-09-03
        • 2015-01-12
        • 1970-01-01
        • 2021-05-11
        • 2020-01-21
        相关资源
        最近更新 更多