【问题标题】:Set pants interpreter for Pyarrow为 Pyarrow 设置裤子解释器
【发布时间】:2019-04-16 11:11:44
【问题描述】:

我正在使用 Pants 为我的项目创建 .pex 文件。我的构建文件使用 3rdparty 逻辑依赖于 pyarrow:'3rdparty/python:pyarrow'。 Pants 使用 C++ 和 Python 库构建 pyarrow,我在 anaconda 中安装了 pyarrow,而不是在标准 python 库中。 Pyprep interpreter.info 给出:/usr/bin/python2.7 作为 Pants 中使用的解释器。如何将其更改为 anaconda python?

【问题讨论】:

    标签: python anaconda pyarrow pants


    【解决方案1】:

    根据您的 Pants 版本更改 pyprep 解释器。如果这是一个相对较新的版本,您可以在 config 中设置解释器。

    下面是我用来覆盖解释器的模式,在这种情况下支持 Python2 和 Python3(%(buildroot)s 是内置的 Pants 配置)。

    [python-setup]
    # Using the modern Pants python backend will allow us to set:
    #   compatibility=[ "CPython>=3" ]
    # on any python_target we want to enforce as Python3.
    interpreter_constraints: ["CPython>=2.7,<3"]
    interpreter_search_paths: [
       '%(buildroot)s/.venv/py2/bin',
       '%(buildroot)s/.venv/py3/bin',
      ]
    

    使用大致相同的配置,但将其指向 anaconda 路径将覆盖解释器。

    我不确定这是否会满足您的要求 - 但它会满足您的要求。

    【讨论】:

      猜你喜欢
      • 2022-07-18
      • 1970-01-01
      • 1970-01-01
      • 2021-06-26
      • 1970-01-01
      • 1970-01-01
      • 2017-12-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多