【问题标题】:error installing rpy2 on Mac在 Mac 上安装 rpy2 时出错
【发布时间】:2018-09-10 03:10:09
【问题描述】:

我正在尝试在 Mac OS High Sierra 版本 10.13.2 上的 python 2.7.14 上安装 rpy2,但是当我尝试编写命令时

pip install rpy2

我得到以下输出:

Collecting rpy2
  Using cached rpy2-2.9.2.tar.gz
    Complete output from command python setup.py egg_info:
    rpy2 is no longer supporting Python < 3. Consider using an older rpy2 release when using an older Python release.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/11/xgl2d8l16wd8xv2_lmdtcmwc0000gn/T/pip-build-aJMHfU/rpy2/
You are using pip version 9.0.1, however version 9.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

我已经尝试通过键入来升级 pip 包

pip install --upgrade pip

但我收到以下消息:

Requirement already up-to-date: pip in /usr/local/lib/python2.7/site-packages
You are using pip version 9.0.1, however version 9.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

我能够在 python3 上安装 rpy2,但由于某种原因它没有安装在 python2 上。

以下是我的 python2 的规范:

Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 12:01:12) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

任何帮助将不胜感激!

【问题讨论】:

    标签: python installation rpy2


    【解决方案1】:

    2.8.6 版本是支持 Python 2.x 系列的最后一个 rpy2 版本。

    您可以告诉 pip 专门安装该版本:

    pip install rpy2==2.8.6
    

    为什么一个包管理器——其生命的全部目的是处理依赖管理——不能自己成功地解决这个问题,我不知道。

    【讨论】:

      【解决方案2】:

      据说最新版本只支持python 3。

      rpy2 is no longer supporting Python < 3. Consider using an older rpy2 release when using an older Python release.
      

      如果你真的需要使用python 2,请尝试下载旧版本的rpy2和build it from source

      【讨论】:

        猜你喜欢
        • 2011-09-25
        • 2013-02-18
        • 2017-11-17
        • 2013-04-05
        • 2014-06-14
        • 2013-02-25
        • 1970-01-01
        • 2012-05-26
        • 2014-05-23
        相关资源
        最近更新 更多