Hi team, I am facing the following issue while usi...
# general
g
Hi team, I am facing the following issue while using the pants 2.14 binary published here in Apple M1 book. It seems to me the binary does not support M1 book? Am I right?
Copy code
./pants --version
Failed to find compatible interpreter on path /Users/266409531:/Users/266409531/Dev/apache-maven-3.8.5/bin:/opt/miniconda3/envs/brain_toy/bin:/opt/miniconda3/condabin:/Users/266409531:/Users/266409531/Dev/apache-maven-3.8.5/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin.

Examined the following interpreters:
1.)                                                        /opt/miniconda3/envs/brain_toy/bin/python3.9 CPython==3.9.13
2.) /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3.8 CPython==3.8.9

No interpreter compatible with the requested constraints was found:

  A distribution for pantsbuild-pants could not be resolved for /opt/miniconda3/envs/brain_toy/bin/python3.9.
  Found 6 distributions for pantsbuild-pants that do not apply:
  1.) The wheel tags for pantsbuild.pants 2.14.0+gitfae1f69f are cp37-cp37m-macosx_10_16_x86_64 which do not match the supported tags of /opt/miniconda3/envs/brain_toy/bin/python3.9:
  cp39-cp39-macosx_12_0_arm64
  ... 367 more ...
  2.) The wheel tags for pantsbuild.pants 2.14.0+gitfae1f69f are cp37-cp37m-manylinux2014_x86_64 which do not match the supported tags of /opt/miniconda3/envs/brain_toy/bin/python3.9:
  cp39-cp39-macosx_12_0_arm64
  ... 367 more ...
  3.) The wheel tags for pantsbuild.pants 2.14.0+gitfae1f69f are cp38-cp38-macosx_11_0_x86_64 which do not match the supported tags of /opt/miniconda3/envs/brain_toy/bin/python3.9:
  cp39-cp39-macosx_12_0_arm64
  ... 367 more ...
  4.) The wheel tags for pantsbuild.pants 2.14.0+gitfae1f69f are cp38-cp38-manylinux2014_x86_64 which do not match the supported tags of /opt/miniconda3/envs/brain_toy/bin/python3.9:
  cp39-cp39-macosx_12_0_arm64
  ... 367 more ...
  5.) The wheel tags for pantsbuild.pants 2.14.0+gitfae1f69f are cp39-cp39-macosx_10_16_x86_64 which do not match the supported tags of /opt/miniconda3/envs/brain_toy/bin/python3.9:
  cp39-cp39-macosx_12_0_arm64
  ... 367 more ...
  6.) The wheel tags for pantsbuild.pants 2.14.0+gitfae1f69f are cp39-cp39-manylinux2014_x86_64 which do not match the supported tags of /opt/miniconda3/envs/brain_toy/bin/python3.9:
  cp39-cp39-macosx_12_0_arm64
  ... 367 more ...
e
It should. We do pulish pantsbuild.pants-2.14.0-cp39-cp39-macosx_11_0_arm64.whl for 2.14.0 (See here: https://pypi.org/project/pantsbuild.pants/2.14.0/#files). And it should be the case that a cp39-cp39-macosx_11_0_arm64 wheel is accepted as compatible for an interpreter whose most specific platform tag is cp39-cp39-macosx_12_0_arm64 like yours.
If you give me a moment I can get you some commands to run using
/opt/miniconda3/envs/brain_toy/bin/python3.9
that will help diagnose further.
g
Sure. I can do that. Thanks for the help
e
Copy code
/opt/miniconda3/envs/brain_toy/bin/python3.9 -mvenv platform_tags.venv
platform_tags.venv/bin/pip -q install pex
platform_tags.venv/bin/pex3 interpreter inspect --python /opt/miniconda3/envs/brain_toy/bin/python3.9 --tags -i2 2>/dev/null | head -25
{
  "path": "/opt/miniconda3/envs/brain_toy/bin/python3.9",
  "compatible_tags": [
    "cp39-cp39-macosx_12_0_arm64",
    ...
Those 3 commands. The output of the final one is what we're after. In particular the tag "cp39-cp39-macosx_11_0_arm64" needs to be in that list for the released wheel to be selected.
h
I recall (and Slack search confirms) multiple people having issues running Pants on a miniconda interpreter. We are working on shipping Pants with an embedded interpreter, so all these problems go away. But for now I recommend installing a vanilla CPython interpreter using pyenv. Those are known to work.
๐Ÿ‘ 1
g
@enough-analyst-54434 this is what I got
Copy code
{
  "path": "/opt/miniconda3/envs/brain_toy/bin/python3.9",
  "compatible_tags": [
    "cp39-cp39-macosx_12_0_arm64",
    "cp39-cp39-macosx_12_0_universal2",
    "cp39-cp39-macosx_11_0_arm64",
    "cp39-cp39-macosx_11_0_universal2",
    "cp39-cp39-macosx_10_16_universal2",
    "cp39-cp39-macosx_10_15_universal2",
    "cp39-cp39-macosx_10_14_universal2",
    "cp39-cp39-macosx_10_13_universal2",
    "cp39-cp39-macosx_10_12_universal2",
    "cp39-cp39-macosx_10_11_universal2",
    "cp39-cp39-macosx_10_10_universal2",
    "cp39-cp39-macosx_10_9_universal2",
    "cp39-cp39-macosx_10_8_universal2",
    "cp39-cp39-macosx_10_7_universal2",
    "cp39-cp39-macosx_10_6_universal2",
    "cp39-cp39-macosx_10_5_universal2",
    "cp39-cp39-macosx_10_4_universal2",
    "cp39-abi3-macosx_12_0_arm64",
    "cp39-abi3-macosx_12_0_universal2",
    "cp39-abi3-macosx_11_0_arm64",
    "cp39-abi3-macosx_11_0_universal2",
    "cp39-abi3-macosx_10_16_universal2",
e
Ok, it's the 3rd tag in the list. Should work unless de-selected by environment markers. Can you run
/opt/miniconda3/envs/brain_toy/bin/python3.9 --markers -i2
and provide the full output?
All this said, what @happy-kitchen-89482 said to do is correct. I'm just trying to figure out the actual problem with miniconda here.
g
btw, this problem only appears in M1. it works with other Apple laptop.
e
Yeah, like Benjy said, M1 / M2 are known to work with Pants only with Python 3.9 and only for standard CPython. There are - IIUC - unknown reasons miniconda / conda Python distributions do not work.
If you can provide the markers using the command above though, it might shed light on that.
You'll have to excuse the Pants developers, I think to a one, for not having any experience with conda / miniconda.
g
Sure. I am asking my colleague to do so :)
I don't have the fortune(or trouble) to use m1 yet.
๐Ÿ˜„ 1
r
Imagine M1 + ventura
g
@enough-analyst-54434 is it the right command? Unknown option --markers
e
Yes, using my rig:
Copy code
$ platform_tags.venv/bin/pex3 interpreter inspect --python python3.9 --markers -i2
{
  "path": "/home/jsirois/.pyenv/versions/3.9.14/bin/python3.9",
  "marker_environment": {
    "implementation_name": "cpython",
    "implementation_version": "3.9.14",
    "os_name": "posix",
    "platform_machine": "x86_64",
    "platform_python_implementation": "CPython",
    "platform_release": "5.15.79.1-microsoft-standard-WSL2",
    "platform_system": "Linux",
    "platform_version": "#1 SMP Wed Nov 23 01:01:46 UTC 2022",
    "python_full_version": "3.9.14",
    "python_version": "3.9",
    "sys_platform": "linux"
  }
}
Perhaps provide
platform_tags.venv/bin/pex3 -V
- the Pex version that go installed. It should be latest / 2.1.118.
But that feature is quite old anyhow.
g
Copy code
{
  "path": "/opt/miniconda3/envs/brain_toy/bin/python3.9",
  "marker_environment": {
    "implementation_name": "cpython",
    "implementation_version": "3.9.13",
    "os_name": "posix",
    "platform_machine": "arm64",
    "platform_python_implementation": "CPython",
    "platform_release": "21.5.0",
    "platform_system": "Darwin",
    "platform_version": "Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000",
    "python_full_version": "3.9.13",
    "python_version": "3.9",
    "sys_platform": "darwin"
  }
}
e
Hrm, yeah - looks fine. I really have no clue what's up with arm miniconda. Hopefully using pyenv or brew or some other means to get a standard CPython 3.9 on the $PATH is a viable option for you. This was Benjy's good advice.
g
Copy code
platform_tags.venv/bin/pex3 -V
2.1.118
@happy-kitchen-89482 do you know how far we will have the Pants with an embedded interpreter?
e
Here is the initial PR: https://github.com/pantsbuild/scie-pants/pull/1 It probably won't be ready for end-user-use until the start of the new Year.
h
Yeah, I do not understand why miniconda (and Python < 3.9 for that matter) don't work well on M1s, but ๐Ÿคท
g
I just try pyenv on M1, it seems not work either. See the error below. > ./pants --version Failed to find compatible interpreter on path /Users/344964838/.pyenv/versions/3.9.13/bin/opt/homebrew/Cellar/pyenv/2.3.9/libexec/opt/homebrew/Cellar/pyenv/2.3.9/plugins/python-build/bin/Users/344964838/.pyenv/shims/opt/homebrew/bin/opt/homebrew/sbin/usr/local/bin/usr/bin/bin/usr/sbin/sbin. Examined the following working interpreters: 1.) /Users/344964838/.pyenv/versions/3.9.13/bin/python3.9 CPython==3.9.13 2.) /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3.8 CPython==3.8.9 Skipped the following broken interpreters: 1.) /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/pythonwrapper.app/Contents/MacOS/pythonwrapper: 2022-12-28 140552.201 pythonwrapper[6346:989479] pythonwrapper is not supposed to be executed directly. Exiting. (See https://github.com/pantsbuild/pex/issues/1027 for a list of known breaks and workarounds.) No working interpreter compatible with the requested constraints was found: A distribution for pantsbuild-pants could not be resolved for /Users/344964838/.pyenv/versions/3.9.13/bin/python3.9. Found 6 distributions for pantsbuild-pants that do not apply: 1.) The wheel tags for pantsbuild.pants 2.14.0+gitfae1f69f are cp37-cp37m-macosx_10_16_x86_64 which do not match the supported tags of /Users/344964838/.pyenv/versions/3.9.13/bin/python3.9: cp39-cp39-macosx_12_0_arm64 ... 367 more ... 2.) The wheel tags for pantsbuild.pants 2.14.0+gitfae1f69f are cp37-cp37m-manylinux2014_x86_64 which do not match the supported tags of /Users/344964838/.pyenv/versions/3.9.13/bin/python3.9: cp39-cp39-macosx_12_0_arm64 ... 367 more ... 3.) The wheel tags for pantsbuild.pants 2.14.0+gitfae1f69f are cp38-cp38-macosx_11_0_x86_64 which do not match the supported tags of /Users/344964838/.pyenv/versions/3.9.13/bin/python3.9: cp39-cp39-macosx_12_0_arm64 ... 367 more ... 4.) The wheel tags for pantsbuild.pants 2.14.0+gitfae1f69f are cp38-cp38-manylinux2014_x86_64 which do not match the supported tags of /Users/344964838/.pyenv/versions/3.9.13/bin/python3.9: cp39-cp39-macosx_12_0_arm64 ... 367 more ... 5.) The wheel tags for pantsbuild.pants 2.14.0+gitfae1f69f are cp39-cp39-macosx_10_16_x86_64 which do not match the supported tags of /Users/344964838/.pyenv/versions/3.9.13/bin/python3.9: cp39-cp39-macosx_12_0_arm64 ... 367 more ... 6.) The wheel tags for pantsbuild.pants 2.14.0+gitfae1f69f are cp39-cp39-manylinux2014_x86_64 which do not match the supported tags of /Users/344964838/.pyenv/versions/3.9.13/bin/python3.9: cp39-cp39-macosx_12_0_arm64 ... 367 more ... A distribution for pantsbuild-pants could not be resolved for /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3.8. Found 6 distributions for pantsbuild-pants that do not apply: 1.) The wheel tags for pantsbuild.pants 2.14.0+gitfae1f69f are cp37-cp37m-macosx_10_16_x86_64 which do not match the supported tags of /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3.8: cp38-cp38-macosx_12_0_arm64 ... 332 more ... 2.) The wheel tags for pantsbuild.pants 2.14.0+gitfae1f69f are cp37-cp37m-manylinux2014_x86_64 which do not match the supported tags of /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3.8: cp38-cp38-macosx_12_0_arm64 ... 332 more ... 3.) The wheel tags for pantsbuild.pants 2.14.0+gitfae1f69f are cp38-cp38-macosx_11_0_x86_64 which do not match the supported tags of /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3.8: cp38-cp38-macosx_12_0_arm64 ... 332 more ... 4.) The wheel tags for pantsbuild.pants 2.14.0+gitfae1f69f are cp38-cp38-manylinux2014_x86_64 which do not match the supported tags of /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3.8: cp38-cp38-macosx_12_0_arm64 ... 332 more ... 5.) The wheel tags for pantsbuild.pants 2.14.0+gitfae1f69f are cp39-cp39-macosx_10_16_x86_64 which do not match the supported tags of /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3.8: cp38-cp38-macosx_12_0_arm64 ... 332 more ... 6.) The wheel tags for pantsbuild.pants 2.14.0+gitfae1f69f are cp39-cp39-manylinux2014_x86_64 which do not match the supported tags of /Library/Developer/... 332 more ...CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3.8: cp38-cp38-macosx_12_0_arm64
Hi guys, I am wondering when pants binary will be shipped with an embedded python interpreter? Do we have a timeline yet?
c
Happy news, itโ€™s already here https://www.pantsbuild.org/v2.15/docs/installation
๐Ÿ‘ 1
g
I will try
Just double check, does pants2.15.0rc4.pex include it?
c
itโ€™s a pants launcher binary, so decoupled from your pants version ๐Ÿ˜‰
~following the steps in the docs should work with any older version of Pants v2.. https://pantsbuild.slack.com/archives/C046T6T9U/p1676324389205209?thread_ts=1670946970.747789&amp;cid=C046T6T9U
g
Em where I can find the binary file for the launcher? Due to the proxy issue, I cannot run the pantsup.sh
h
You'll probably have to use 2.15.0rc5 with the launcher binary (there was a concurrency bug in earlier versions)
(that script is now
get-pants.sh
)
I just updated the docs
If you can't run https://static.pantsbuild.org/setup/get-pants.sh you can look inside it to see where it fetches binaries (it's from github releases in this repo: https://github.com/pantsbuild/scie-pants/
You'll have to host those or proxy to them
g
Thanks @happy-kitchen-89482. I take a look at the scie-pants. If I understand it correctly, scie-pants will get pants ready (here I assume scie-pants will download pants behind the scenes. I am wondering if it is possible to ask scie-pants use pants binary downloaded earlier?
e
Aha, no - not today. In fact,
scie-pants
(just like
./pants
) only works by installing Pants releases from PyPI. I remember your case @gray-shoe-19951, you use the released multi-platform mega-
pants.pex
since that allows you to download one thing and then bring that 1 thing inside your org. A few questions: 1. If
scie-pants
supported downloading
pants.pex
instead of installing the
pantsbuild.pants
distribution - would you be hosting
pnats.pex
in an internal service or do you check
pants.pex
into the repo today and so you'd want
scie-pants
to just call
/scie-pants/hermetic/python3.9 ./pants.pex
? 2. The
scie-pants
binary dynamicall downloads a hermetic CPython 3.9 to use appropriate to the current platform. These come from the Python Build Standalone project but can be re-directed as described here under "Partial support for firewalls". Does that suffice? In other words can you download the ones you need and host them internally and set up that
PANTS_BOOTSTRAP_URLS
env var described in the README?