【问题标题】:Autotools - Use Python 2.7 when Python 3 is availableAutotools - 当 Python 3 可用时使用 Python 2.7
【发布时间】:2017-09-07 18:00:44
【问题描述】:

我使用 Arch Linux。 python --version 返回 Python 3.6.2,python2 --version(和 python2.7 --version)返回 Python 2.7.13。 Automake 搜索比 2.4 更新的 python 并找到 python (3.6)。不过,该项目不适用于 python 3。 AM_PATH_PYTHON(<min-version>[,...]) 不允许指定最高版本。

如果python 太新,我如何自动搜索python2?或者有没有更好的方法来处理这个问题?如果版本正确,Automake 仍应找到 python,因为此构建需要能够在具有较旧软件包的发行版上运行(例如,Ubuntu 14.04)。

【问题讨论】:

    标签: python linux python-2.7 archlinux automake


    【解决方案1】:

    PYTHONAM_PATH_PYTHON 设置为precious variable,您可以在配置时覆盖其选择:

    $ PYTHON=python2 ./configure
    

    【讨论】:

      【解决方案2】:

      在上游修复之前,我会这样做:

      mkdir ~/autotools_bin/
      ln -s /usr/bin/python2 ~/autotools_bin/python
      export PATH="~/autotools_bin:$PATH"
      

      然后它只能找到python2(命名为python)并且您的系统没有搞砸,只有您使用更改的PATH运行的进程。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2019-04-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-02-13
        • 2012-08-05
        • 1970-01-01
        相关资源
        最近更新 更多