Should we recommend this setting in example repo, ...
# development
p
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
What does conda prefix refer to? I don't have much familiarity with how conda installs interpreters
p
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
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
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
How did you add it, e.g. env var or pants.toml?
p
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
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
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