How to make —build_python_zip work with pyenv?

212 views
Skip to first unread message

Johnny Huo

unread,
May 26, 2021, 12:32:27 PM5/26/21
to bazel-discuss

Hi team,

I’m trying to build executable zip file for python, code is using pyenv to specify python versions for PY2 and PY3.
Code repo can be found here.

bazel run, bazel build both works

$ bazel run //src/main/python/simple:py2only
$ bazel run //src/main/python/simple:py3only

however when trying the build with —build_python_zip, it shows following error, is this a bug or am I missing anything?

ERROR: /bazel_workspace/simple_python_bazel/src/main/python/simple/BUILD:14:10: PythonZipper src/main/python/simple/py3only.zip failed: I/O exception during sandboxed execution: /private/var/tmp/_bazel_xhuo/3a5ce2a9c140cbad70cca63ba9410ee9/sandbox/darwin-sandbox/3/execroot/__main__/external/pyenv/versions/3.9.4/bin (File exists)

a​



Johnny Huo

unread,
Jun 22, 2021, 2:24:41 PM6/22/21
to bazel-discuss
Worked around it by using system installed python interpreter instead of pyenv. Example can be found in the repo. 
Reply all
Reply to author
Forward
0 new messages