:wave: - i have some issues getting a custom pytho...
# general
s
👋 - i have some issues getting a custom python path resolved:
Copy code
[python-bootstrap]
search_path = [
    "<PATH>",
    "<PYENV>",
"$HOME/workspace/.pythoninterpreters/python3.10.13/python/install/bin",
]
basically pants wont find the interpreter in the custom path (
$HOME/...
). If i add that path to my
PATH
env var it works fine - does it not like the env var syntax?
f
You need to use the
env
function in BUILD files to access environment variables. You could write that path as:
Copy code
f"{env('HOME')}/workspace/.pythoninterpreters/python3.10.13/python/install/bin"
s
ha, literally just sorted it out with
"%(buildroot)s/.python/python3.10.13/python/install/bin"
; i didn't realize it needed special interpretation
ty!
f
buildroot
is injected as a Python variable into the BUILD file so that is why it is available.
and I wonder if the %(...)s syntax could work with
env
I'm assuming the f-string syntax works in any event.
s
ah i see
either way, good to remember that it's python and you can use fstrings, ty