【发布时间】:2021-09-25 04:19:17
【问题描述】:
我正在尝试将 Pybind 与 Bazel 一起使用,并且我一直遵循以下说明: https://github.com/pybind/pybind11_bazel
一切正常,我可以通过工作区中的以下命令强制它使用 Python3:
python_configure(name = "local_config_python", python_version = "3")
但是,关于如何在虚拟环境中使用特定 python 的说明完全不清楚
这个文件在这里https://github.com/pybind/pybind11_bazel/blob/master/python_configure.bzl 说我们必须设置两个变量:
"""Repository rule for Python autoconfiguration.
`python_configure` depends on the following environment variables:
* `PYTHON_BIN_PATH`: location of python binary.
* `PYTHON_LIB_PATH`: Location of python libraries.
"""
我设置了它们,但它实际上并不尊重这些值。我如何才能真正传递这些变量,也许是在我的cc_library 命令中。是否有 API 可以在我的工作区中设置 Python 路径?
【问题讨论】: