Hi guys, what's the python version required to run...
# general
p
Hi guys, what's the python version required to run pants 2.16 on Mac with M2? We are getting some weird failures when running with python 3.8 (pants.toml has it configured in interpreter constraintsn) like - bandit fails to install properly for example... Can that be related?
c
The preferred way is to use the scie-pants launcher binary, that way the Python interpreter for pants comes bundled for you out-of-the box. See https://www.pantsbuild.org/docs/installation Otherwise, you need to use Python 3.9 on Mac’s, there are known issues with using 3.8.
N.b. this is for pants itself, your project should not be limited by this.
p
Hmm, maybe I misunderstood how this is done, but • we use launcher (installed by get-pants.sh) • we have tests running in docker_environment that is ubuntu based (it has python 3.8) - that's we we have set interpreter constraint in pants.toml python section to CPython==3.8.* • linters work on host machine, but some of them (not all need it) had interpreter_constraints set to 3.8 as well, as we use the same lockfile for tools and other requirements, I think mypy was complaining that something didn't match - I don't remember that exactly at the moment unfortunately, but I can check - it was on pants 2.15.0 though So, when pants runs linters, it will be run by 3.8 in that case, or launcher will still use 3.9 for pants only?
c
Ah, tools (such as linters etc) are run with the interpreter found on your system I believe rather than the Python bundled for pants itself. There may be caveats here though, I think @bitter-ability-32190 can correct me if I’m wrong or else fill in more details..
p
ok I can confirm changing constraints to 3.9 and regenerating lockfile solves bandit failing to install pyyaml issue on M2...
👍 1
ok, to sum it up,
Otherwise, you need to use Python 3.9 on Mac’s, there are known issues with using 3.8.
if there are any python3.8 related problems, that shouldn't be pants related, as it runs on whatever is provided by scie-pants launcher
thanks for clarifying!
c
yep
1