Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip doesn't install latest version of onnxruntime #17166

Closed
vinayvaddiparthi opened this issue Aug 15, 2023 · 5 comments
Closed

pip doesn't install latest version of onnxruntime #17166

vinayvaddiparthi opened this issue Aug 15, 2023 · 5 comments
Assignees
Labels
build build issues; typically submitted using template

Comments

@vinayvaddiparthi
Copy link

Describe the issue

When trying to install onnxruntime>=1.14.1 on Mac M1, I get a no matching distribution error

> pip install "onnxruntime>=1.14.1"                                                                                                                                                                   
ERROR: Could not find a version that satisfies the requirement onnxruntime>=1.14.1 (from versions: 1.12.0)
ERROR: No matching distribution found for onnxruntime>=1.14.1

Doing an unbounded pip install installs version 1.12.0

 ❯ pip install --no-cache-dir onnxruntime                                                                                                                                                              
Collecting onnxruntime
  Downloading onnxruntime-1.12.0-cp310-cp310-macosx_10_15_universal2.whl (6.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.0/6.0 MB 35.8 MB/s eta 0:00:00
Collecting coloredlogs (from onnxruntime)
  Downloading coloredlogs-15.0.1-py2.py3-none-any.whl (46 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.0/46.0 kB 179.6 MB/s eta 0:00:00
Collecting flatbuffers (from onnxruntime)
  Obtaining dependency information for flatbuffers from https://files.pythonhosted.org/packages/6f/12/d5c79ee252793ffe845d58a913197bfa02ae9a0b5c9bc3dc4b58d477b9e7/flatbuffers-23.5.26-py2.py3-none-any.whl.metadata
  Downloading flatbuffers-23.5.26-py2.py3-none-any.whl.metadata (850 bytes)
Requirement already satisfied: numpy>=1.21.0 in ./.venv/lib/python3.10/site-packages (from onnxruntime) (1.25.2)
Collecting packaging (from onnxruntime)
  Downloading packaging-23.1-py3-none-any.whl (48 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 kB 19.0 MB/s eta 0:00:00
Collecting protobuf (from onnxruntime)
  Obtaining dependency information for protobuf from https://files.pythonhosted.org/packages/01/f5/4d4465795340d288de56ecae61fac7d3a646eb26dc6face8578d31fcafff/protobuf-4.24.0-cp37-abi3-macosx_10_9_universal2.whl.metadata
  Downloading protobuf-4.24.0-cp37-abi3-macosx_10_9_universal2.whl.metadata (540 bytes)
Collecting sympy (from onnxruntime)
  Downloading sympy-1.12-py3-none-any.whl (5.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.7/5.7 MB 87.4 MB/s eta 0:00:00
Collecting humanfriendly>=9.1 (from coloredlogs->onnxruntime)
  Downloading humanfriendly-10.0-py2.py3-none-any.whl (86 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 86.8/86.8 kB 258.7 MB/s eta 0:00:00
Collecting mpmath>=0.19 (from sympy->onnxruntime)
  Downloading mpmath-1.3.0-py3-none-any.whl (536 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 536.2/536.2 kB 118.7 MB/s eta 0:00:00
Downloading flatbuffers-23.5.26-py2.py3-none-any.whl (26 kB)
Downloading protobuf-4.24.0-cp37-abi3-macosx_10_9_universal2.whl (409 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 409.6/409.6 kB 136.8 MB/s eta 0:00:00
Installing collected packages: mpmath, flatbuffers, sympy, protobuf, packaging, humanfriendly, coloredlogs, onnxruntime
Successfully installed coloredlogs-15.0.1 flatbuffers-23.5.26 humanfriendly-10.0 mpmath-1.3.0 onnxruntime-1.12.0 packaging-23.1 protobuf-4.24.0 sympy-1.12

When I perform pip install -v onnxruntime, I see that it is skipping all the wheels except the below wheel due to compatibility issues
Wheel: /packages/83/cc/2ed69b0cf2dba2937b4d5bd65c7e3800f1c4f3624fc33ad20e9add636bba/onnxruntime-1.12.0-cp310-cp310-macosx_10_15_universal2.whl
Log which skips the wheels:

Skipping link: none of the wheel's tags (cp310-cp310-macosx_10_15_x86_64) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/3e/ee/07d0857d53fc70a2041b7a42000cb6b5641e0b3133c238099756fa07cc9b/onnxruntime-1.15.1-cp310-cp310-macosx_10_15_x86_64.whl (from https://pypi.org/simple/onnxruntime/)
Skipping link: none of the wheel's tags (cp310-cp310-macosx_11_0_arm64) are compatible (run pip debug --verbose to show compatible tags): https://files.pythonhosted.org/packages/cf/06/0c6e355b9ddbebc34d0e21bc5be1e4bd2c124ebd9030525838fa6e65eaa8/onnxruntime-1.15.1-cp310-cp310-macosx_11_0_arm64.whl (from https://pypi.org/simple/onnxruntime/)

Running pip debug --verbose | grep -i cp310-cp310 prints the following which doesn't have macosx_11_0_arm64 which I'm not sure how to get.

This is what I feel is causing the issue and I'm not sure how to get or build wheels for the existing platforms that I see.

❯ pip debug --verbose | grep -i cp310-cp310                                                                                                                                                          
WARNING: This command is only meant for debugging. Do not use this with automation for parsing and getting these details, since the output and options of this command may change without notice.
  cp310-cp310-macosx_10_16_arm64
  cp310-cp310-macosx_10_16_universal2
  cp310-cp310-macosx_10_15_arm64
  cp310-cp310-macosx_10_15_universal2
  cp310-cp310-macosx_10_14_arm64
  cp310-cp310-macosx_10_14_universal2
  cp310-cp310-macosx_10_13_arm64
  cp310-cp310-macosx_10_13_universal2
  cp310-cp310-macosx_10_12_arm64
  cp310-cp310-macosx_10_12_universal2
  cp310-cp310-macosx_10_11_arm64
  cp310-cp310-macosx_10_11_universal2
  cp310-cp310-macosx_10_10_arm64
  cp310-cp310-macosx_10_10_universal2
  cp310-cp310-macosx_10_9_arm64
  cp310-cp310-macosx_10_9_universal2
  cp310-cp310-macosx_10_8_arm64
  cp310-cp310-macosx_10_8_universal2
  cp310-cp310-macosx_10_7_arm64
  cp310-cp310-macosx_10_7_universal2
  cp310-cp310-macosx_10_6_arm64
  cp310-cp310-macosx_10_6_universal2
  cp310-cp310-macosx_10_5_arm64
  cp310-cp310-macosx_10_5_universal2
  cp310-cp310-macosx_10_4_arm64
  cp310-cp310-macosx_10_4_universal2
  cp310-cp310-macosx_10_3_arm64
  cp310-cp310-macosx_10_3_universal2
  cp310-cp310-macosx_10_2_arm64
  cp310-cp310-macosx_10_2_universal2
  cp310-cp310-macosx_10_1_arm64
  cp310-cp310-macosx_10_1_universal2
  cp310-cp310-macosx_10_0_arm64
  cp310-cp310-macosx_10_0_universal2

To reproduce

> arch
arm64
> python --version
3.10.12
> python -m venv .venv
> source .venv/bin/activate
> pip install "onnxruntime>=1.14.1"                                                                                                                                                                   
ERROR: Could not find a version that satisfies the requirement onnxruntime>=1.14.1 (from versions: 1.12.0)
ERROR: No matching distribution found for onnxruntime>=1.14.1

Urgency

No response

Platform

Mac

OS Version

13.5

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.15.1

ONNX Runtime API

Python

Architecture

ARM64

Execution Provider

Default CPU

Execution Provider Library Version

No response

@snnn snnn self-assigned this Aug 15, 2023
@snnn
Copy link
Member

snnn commented Aug 15, 2023

Thanks for reporting the bug. It is very interesting. Starting from 1.12.1 release, our packaging pipeline no longer generates universal2 packages, and I don't see what code change could make it: v1.12.0...v1.12.1

@snnn
Copy link
Member

snnn commented Aug 15, 2023

Your OS version is 13.5, but your pip doesn't seem to accept tags for macOS 11.x. So, maybe you should upgrade your pip?

See: https://pip.pypa.io/en/stable/installation/#upgrading-pip

@vinayvaddiparthi
Copy link
Author

vinayvaddiparthi commented Aug 15, 2023

Firstly, thank you for looking into this.

I'm already on the latest version of pip. I'm wondering if it's got to do anything with pyenv which I use as the base Python and use it to create venvs

❯ pip install --upgrade pip                                                                                                                                                                          
Requirement already satisfied: pip in ./.venv/lib/python3.10/site-packages (23.2.1)
❯ pip install --no-cache-dir "onnxruntime>=1.14.1"                                                                                                                                                   
ERROR: Could not find a version that satisfies the requirement onnxruntime>=1.14.1 (from versions: 1.12.0)
ERROR: No matching distribution found for onnxruntime>=1.14.1

@snnn snnn added the build build issues; typically submitted using template label Aug 16, 2023
@mayeut
Copy link
Contributor

mayeut commented Aug 25, 2023

This is an issue with python built with old macOS SDK.
there's a fix / workaround in pypa/packaging for this but it did not land in pip yet.
You can try:

SYSTEM_VERSION_COMPAT=0 pip install --no-cache-dir "onnxruntime>=1.14.1"

xref pypa/packaging#497 / pypa/pip#11715

@vinayvaddiparthi
Copy link
Author

Thank you very much, @mayeut ! I tested this and it works.

I spent many hours trying to figure out the root cause, so I appreciate the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template
Projects
None yet
Development

No branches or pull requests

3 participants