在bazel中使用pybind,但设置python路径?

mgdq6dx1  于 2021-08-20  发布在  Java
关注(0)|答案(0)|浏览(476)

我正在尝试将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 指挥部。在我的工作区中是否有设置python路径的api?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题