wheel: pip install failed on MacOS Big Sur because build wheel with unsupported tag

Hi, Currently our Python package (ONNX) encounters a build error while pip install it on the latest MacOS version (Big Sur). The script we used:

#!/bin/bash
git clone --recursive https://github.com/onnx/onnx.git
python -m venv env
source ./venv/source/activate
export ONNX_ML=1
export ONNX_NAMESPACE=onnx
python -m pip install --upgrade pip
python -m pip install --use-feature=2020-resolver --upgrade protobuf
python -m pip install ./onnx

The error is as follows:

  Copying onnx.egg-info to build/bdist.macosx-10.15-x86_64/wheel/onnx-1.8.0-py3.8.egg-info
  running install_scripts
  [WARNING] This wheel needs a higher macOS version than the version your Python interpreter is compiled against.  To silence this warning, set MACOSX_DEPLOYMENT_TARGET to at least 11_0 or recreate these files with lower MACOSX_DEPLOYMENT_TARGET:
  build/bdist.macosx-10.15-x86_64/wheel/onnx/onnx_cpp2py_export.cpython-38-darwin.soTraceback (most recent call last):
    File "/Users/xxxxxxxxxx/env/onnx/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
  AssertionError: would build wheel with unsupported tag ('cp38', 'cp38', 'macosx_11_0_x86_64')

I suspect it might be a pip issue instead of the Python library (ONNX) issue. Has wheel packaging supported the latest macOS (11.0) yet? At least I don’t see such tag (cp-38-cp38-macosx_11_0_x86_64) in my local packaging.list(tags.sys_tags(). Could anyone help me to take a look at this issue? Thank you!

Reference: https://github.com/onnx/onnx/issues/3114

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 28 (15 by maintainers)

Most upvoted comments

Greetings; I think I’m also afflicted by this problem, or something similar. I encountered this while building out a fresh python3.9 venv and then installing various packages into it. python3.9 is provided by brew, but all package management happens with pip inside a virtualenv (via virtualenvwrapper). pip install scikit-learn reliably fails with:

      assert tag in supported_tags, "would build wheel with unsupported tag {}".format(tag)
  AssertionError: would build wheel with unsupported tag ('cp39', 'cp39', 'macosx_11_0_x86_64')

complete output: pip-install-scikit-learn.txt

Checking my supported tags, it does seem as though “macosx_11_0_x86_64” is not represented. I also tried updating wheel with pip install wheel@git+http://github.com/pypa/wheel but that didn’t seem to help.

Also (not sure if this is strictly related to this issue’s problem): I noticed that the scikit-learn build (and maybe others?) are not building with the expected toolchain; below we see that the default toolchain isn’t the one being invoked.

❯ xcode-select -p
/Applications/Xcode-GM.app/Contents/Developer

(excerpt from pip-install-scikit-learn.txt)

  C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers

In this case, Xcode.app should generally be valid, but is a slightly older version than Xcode-GM.app and only has a macOS SDK - not the iOS family of SDKs (there’s a reason 😉.

Once this has been tested to work, I will make a new release.