https://pantsbuild.org/ logo
#development
Title
# development
p

plain-sundown-25537

04/22/2021, 9:37 PM
Should we recommend this setting in example repo, to fit people who uses conda / pyenv?
Copy code
interpreter_search_paths = ["<PATH>", "<CONDA_PREFIX>","<PYENV>"]
It took me a while to puzzle which python environment I was using
h

hundreds-father-404

04/22/2021, 9:40 PM
What does conda prefix refer to? I don't have much familiarity with how conda installs interpreters
p

plain-sundown-25537

04/22/2021, 9:40 PM
conda
lots of DS uses them
especially for notebook use etc
Copy code
❯ export |grep conda
CONDA_EXE=/Users/xx/opt/anaconda3/bin/conda
CONDA_PREFIX=/Users/xx/opt/anaconda3/envs/pants
CONDA_PREFIX_1=/Users/xx/opt/anaconda3
CONDA_PYTHON_EXE=/Users/xx/opt/anaconda3/bin/python
or we can add into the document
h

hundreds-father-404

04/22/2021, 9:43 PM
Cool, that last message is what I was wondering. Is conda setting those env vars for you? or we can add into the document Not quite, this would be a new feature for Pants to understand a special string <CONDA> and know how to introspection your environment to find the relevant interpreter
p

plain-sundown-25537

04/22/2021, 9:46 PM
Cool, that last message is what I was wondering. Is conda setting those env vars for you? =>yes
I added “<CONDA_PREFIX>” and it works. Hmm .. - do you mean it shouldn’t?
h

hundreds-father-404

04/22/2021, 9:53 PM
How did you add it, e.g. env var or pants.toml?
p

plain-sundown-25537

04/22/2021, 9:56 PM
Here is my confusing steps - 1. Initially my build failed to get python interepter after dropping the pants into conda venv 2. I added
<CONDA_PREFIX>
in
pants.toml
then it worked 3. I thought I fixed it but I removed
<CONDA_PREFIX>
, and all cache (~/.cache/pants, .cache) - and it still works
i suspect it is cache in pantsd
so I believe this may be false alarm
h

hundreds-father-404

04/22/2021, 9:59 PM
Yeah it probably is pantsd, you can
rm -rf .pids
to force Pantsd to restart. But yeah, Pants has no knowledge of what
<CONDA_PREFIX>
is and will try interpreting that as a literal path, similar to
/usr/bin/python
. Because no Python interpreter exists there, it gets essentially ignored
p

plain-sundown-25537

04/22/2021, 10:04 PM
Copy code
❯ which python
/Users/xx/opt/anaconda3/envs/pants/bin/python
conda setting (example)
pants
is env name
@hundreds-father-404 do we have ./pants cleanup/reset equivalent?
it is good to at least give instruction about
clean up