Python Conda安装旧版本的matplotlib keyerror linux3

2024-09-28 22:25:05 发布

您现在位置:Python中文网/ 问答频道 /正文

在尝试从开发版本(SVN trunk,如这里所示:http://pprospector.sourceforge.net/install/install.html)安装工具PrimerProspector时,我尝试创建一个conda环境以优雅的方式解决依赖关系(我正在运行一个带有conda 4.4.8的Ubuntu服务器16.04.3lts机器)。当环境(使用Python2.6)激活时,可以使用pip install轻松地将PyCogent和Numpy安装到所需的版本中。我的频道里有康达·福吉。但是,在运行pip install matplotlib==0.98.5.3时,我遇到了这样一个问题:没有可用的版本(Could not find a version that satisfies the requirement matplotlib==0.98.5.3 (from versions: 0.86, 0.86.1, 0.86.2, 0.91.0, 0.91.1, 1.0.1, 1.1.0, 1.1.1, 1.2.0, 1.2.1, 1.3.0, 1.3.1, 1.4.0, 1.4.1rc1, 1.4.1, 1.4.2, 1.4.3, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 2.0.0b1, 2.0.0b2, 2.0.0b3, 2.0.0b4, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1, 2.0.2, 2.1.0rc1, 2.1.0, 2.1.1, 2.1.2))。另外,我还得到了一个不安全的platformwarning,这显然与旧的Python发行版很常见。然而,由于源代码可用,我尝试使用piptarball安装。这给了我一个相当缺乏信息的KeyError: 'linux3'

Complete output from command python setup.py egg_info:
    ============================================================================
    BUILDING MATPLOTLIB
                matplotlib: 0.98.5.3
                    python: 2.6.9 | packaged by conda-forge | (unknown, Apr 29
                            2017, 15:44:38)  [GCC 4.8.2 20140120 (Red Hat
                            4.8.2-15)]
                  platform: linux3

    REQUIRED DEPENDENCIES
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/tmp/pip-7ZwjL5-build/setup.py", line 99, in <module>
        if not check_for_numpy():
      File "setupext.py", line 497, in check_for_numpy
        add_base_flags(module)
      File "setupext.py", line 319, in add_base_flags
        [os.path.join(p, 'include') for p in basedir[sys.platform] ])
    KeyError: 'linux3'

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

直接运行设置.py解开后也会呈现相同的错误。有人知道怎么解决这个问题吗?有什么我能做的吗?在


Tags: installpipinfrompy版本for环境
1条回答
网友
1楼 · 发布于 2024-09-28 22:25:05

您尝试使用的mathplotlib版本在linux3.0发布之前已经发布了很多年。这就是为什么它不支持sys.platform='linux3'。而且您使用的Python版本早于2.7.2,它删除了linux3值的设置。在

您可以尝试在tarball中编辑setupext.py文件,并在dict basedir中为linux3添加配置,这与linuxlinux2的配置相同。在

相关问题 更多 >