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 install onnxruntime --- No matching distribution found for onnxruntime #11037

Closed
davidatorres opened this issue Mar 28, 2022 · 23 comments
Closed

Comments

@davidatorres
Copy link

Describe the bug
Unable to install onnxruntime via pip/pip3

Urgency
Trying to get this up and running for a business project we have due in a couple weeks.

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 11 & Mac OSX (latest)
  • ONNX Runtime installed from (source or binary): binary (attempting - pip install onnxruntime)
  • ONNX Runtime version: 1.11.0
  • Python version: 3.9
  • Visual Studio version (if applicable): VS Code (latest) / Juptyer (latest)
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version:
  • GPU model and memory:

To Reproduce
pip install onnxruntime

Expected behavior
Installation of runtime libraries

Screenshots
2022-03-28_16-39-04

@faxu
Copy link
Contributor

faxu commented Mar 29, 2022

CC @chilo-ms

Does this repro on Windows or just on Mac? What is the specific version of Mac you are using?

@ShomyLiu
Copy link

Same issue on MacOS with MacBook Pro( M1 2020) , macOS Monterey 12.1;
Python 3.9

pip3 install onnxruntime 
ERROR: Could not find a version that satisfies the requirement onnxruntime (from versions: none)
ERROR: No matching distribution found for onnxruntime

@faxu @chilo-ms

@pranavsharma
Copy link
Contributor

We don't support packages for M1 yet.
It works just fine for other macosx versions. Tested on Catalina 10.15.7.

(py39) MACHINE-M-Q132:~ MACHINE$ pip install onnxruntime
Collecting onnxruntime
  Downloading onnxruntime-1.11.0-cp39-cp39-macosx_10_15_x86_64.whl (5.7 MB)
     |████████████████████████████████| 5.7 MB 3.5 MB/s 
Collecting numpy>=1.21.0
  Downloading numpy-1.22.3-cp39-cp39-macosx_10_14_x86_64.whl (17.6 MB)
     |████████████████████████████████| 17.6 MB 4.2 MB/s 
Collecting flatbuffers
  Downloading flatbuffers-2.0-py2.py3-none-any.whl (26 kB)
Collecting protobuf
  Downloading protobuf-3.19.4-cp39-cp39-macosx_10_9_x86_64.whl (961 kB)
     |████████████████████████████████| 961 kB 3.6 MB/s 
Installing collected packages: protobuf, numpy, flatbuffers, onnxruntime
Successfully installed flatbuffers-2.0 numpy-1.22.3 onnxruntime-1.11.0 protobuf-3.19.4

(py39) MACHINE-M-Q132:~ MACHINE$ python -V
Python 3.9.11
(py39) MACHINE-M-Q132:~ MACHINE$ python
Python 3.9.11 (main, Mar 28 2022, 05:06:49) 
[Clang 12.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.

i>>> import onnxruntime as rt
>>> rt.__version__
'1.11.0'
>>> 

@troyliu0105
Copy link

for now, there is a workaround for u. to install onnxruntime on Apple silicon with conda-forge

conda install onnxruntime -c conda-forge

@ShomyLiu @davidatorres

@mattbell87
Copy link

I'm getting this error just today on Windows and Docker (alpine container)

@ShomyLiu
Copy link

@troyliu0105 thanks for the solution. That is indeed works except that I have to install anconda and set a new python environmen since i use the native python environment.
Thanks all.

@troyliu0105
Copy link

@troyliu0105 thanks for the solution. That is indeed works except that I have to install anconda and set a new python environmen since i use the native python environment. Thanks all.

And I tried to compile the wheels for Python 3.8/3.9 (Apple Silicon), maybe u need it. and here is the command I used to compile them (Tested on Macbook M1 Pro)

./build.sh --config Release --osx_arch arm64 --osx_arch arm64 --build_wheel --enable_pybind --parallel --use_coreml --use_extensions --skip_tests --build_shared_lib

image

onnxruntime-1.11.0-cp38-cp38-macosx_12_0_arm64.whl
onnxruntime-1.11.0-cp39-cp39-macosx_12_0_arm64.whl

@ShomyLiu
Copy link

@troyliu0105 great!
Thanks a lot for this compile command and the whl files. It helps a lot

@davidatorres
Copy link
Author

@troyliu105 - Using Conda worked for me on Mac OSX with Python 3.9, but fails on Windows with Python 3.10.

conda install onnxruntime -c conda-forge

@venttola
Copy link

venttola commented Mar 29, 2022

Same issue on Manjaro Linux 21.2.5 with Python 3.10.2.

pip install  onnxruntime
ERROR: Could not find a version that satisfies the requirement onnxruntime (from versions: none)
ERROR: No matching distribution found for onnxruntime

However my docker build works and I am using public.ecr.aws/lambda/python:3.8 as base image.

@troyliu0105
Copy link

@davidatorres @venttola for now, offical pypi only has wheels for 3.7 to 3.9. If you wanna use onnxruntime with 3.10. You should compile it by yourself.

@venttola
Copy link

@troyliu0105 Thanks! I should have probably discovered this by myself. Works with Python 3.9.

@faxu
Copy link
Contributor

faxu commented Mar 29, 2022

We'll plan to add 3.10 soon so thank you for your input!

@faxu faxu closed this as completed Mar 29, 2022
@amibeuret
Copy link

@troyliu0105 thanks for the solution. That is indeed works except that I have to install anconda and set a new python environmen since i use the native python environment. Thanks all.

And I tried to compile the wheels for Python 3.8/3.9 (Apple Silicon), maybe u need it. and here is the command I used to compile them (Tested on Macbook M1 Pro)

./build.sh --config Release --osx_arch arm64 --osx_arch arm64 --build_wheel --enable_pybind --parallel --use_coreml --use_extensions --skip_tests --build_shared_lib
image

onnxruntime-1.11.0-cp38-cp38-macosx_12_0_arm64.whl onnxruntime-1.11.0-cp39-cp39-macosx_12_0_arm64.whl

Thanks, this was really helpful!

@JeyDi
Copy link

JeyDi commented May 18, 2022

@troyliu0105 thanks for the solution. That is indeed works except that I have to install anconda and set a new python environmen since i use the native python environment. Thanks all.

And I tried to compile the wheels for Python 3.8/3.9 (Apple Silicon), maybe u need it. and here is the command I used to compile them (Tested on Macbook M1 Pro)

./build.sh --config Release --osx_arch arm64 --osx_arch arm64 --build_wheel --enable_pybind --parallel --use_coreml --use_extensions --skip_tests --build_shared_lib
image

onnxruntime-1.11.0-cp38-cp38-macosx_12_0_arm64.whl onnxruntime-1.11.0-cp39-cp39-macosx_12_0_arm64.whl

Thank you this is very helpful..however remember to install numpy in your python environment before launching this command.

ps: I wrote a simple process here to install in your machine and build the wheel.

# clone the project locally (for example onnxruntime)

# remember to install numpy and wheel in your python environment (the package will be compiled with the python version you have installed)
# if you have pyenv be sure to use the right python version: pyenv shell 3.9.12 (for example)
pip install numpy wheel

# It's also good to have installed some brew packages if you are on mac (required for example with skl2onnx)
brew install cmake protobuf

# launch this command inside the project
./build.sh --config Release --osx_arch arm64 --osx_arch arm64 --build_wheel --enable_pybind --parallel --use_coreml --use_extensions --skip_tests --build_shared_lib

# you can find the wheel builded inside the folder: onnxruntime/build/<OperatingSystem/Release/dist
# add the wheel inside your project (copy and paste)

# if you are using poetry you can install the wheel by inserting this line in the pyproject.toml (put this on tool.poetry.dependencies)
onnxruntime = { file = "onnx/the-package-name-compiled.whl" }

# Then you can install with
poetry install

# Instead you can use directly pip
pip install the-package-name-compiled.whl

If you want more informations on build you can also look the official documentation here

@themanyone
Copy link

themanyone commented Apr 6, 2023

Thanks for suggestions. I had to use python3.10 -m pip install onnxruntime because of python3.11 being default.

Edit: Much later, after being given every possible hint without straight up telling me, I "discovered" that, if I didn't set up venv using the right version of python to begin with, I can still go inside the venv and make python and pip a simlink to whatever versions I want. And when old docs say python3 they usually mean python3.10 or maybe someday a later version. Was I expected to know this all along?

ln -sf python3.10 python
ln -sf python3.10 python3
ln -sf pip3.10 pip
ln -sf pip3.10 pip3

@wixphotos
Copy link

We don't support packages for M1 yet. It works just fine for other macosx versions. Tested on Catalina 10.15.7.

(py39) MACHINE-M-Q132:~ MACHINE$ pip install onnxruntime
Collecting onnxruntime
  Downloading onnxruntime-1.11.0-cp39-cp39-macosx_10_15_x86_64.whl (5.7 MB)
     |████████████████████████████████| 5.7 MB 3.5 MB/s 
Collecting numpy>=1.21.0
  Downloading numpy-1.22.3-cp39-cp39-macosx_10_14_x86_64.whl (17.6 MB)
     |████████████████████████████████| 17.6 MB 4.2 MB/s 
Collecting flatbuffers
  Downloading flatbuffers-2.0-py2.py3-none-any.whl (26 kB)
Collecting protobuf
  Downloading protobuf-3.19.4-cp39-cp39-macosx_10_9_x86_64.whl (961 kB)
     |████████████████████████████████| 961 kB 3.6 MB/s 
Installing collected packages: protobuf, numpy, flatbuffers, onnxruntime
Successfully installed flatbuffers-2.0 numpy-1.22.3 onnxruntime-1.11.0 protobuf-3.19.4

(py39) MACHINE-M-Q132:~ MACHINE$ python -V
Python 3.9.11
(py39) MACHINE-M-Q132:~ MACHINE$ python
Python 3.9.11 (main, Mar 28 2022, 05:06:49) 
[Clang 12.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.

i>>> import onnxruntime as rt
>>> rt.__version__
'1.11.0'
>>> 

Hi, any idea when M1, M2 and M3 will be supported?

@jainabhishek
Copy link

I faced the same issue and the following command worked for me:
python3 -m pip install onnxruntime

@sidsarasvati
Copy link

I faced the same issue and the following command worked for me: python3 -m pip install onnxruntime

This worked
Why?

@devinschumacher
Copy link

I faced the same issue and the following command worked for me: python3 -m pip install onnxruntime

This worked Why?

Running python3 -m pip install onnxruntime ensures that onnxruntime is installed in the specific environment associated with the python3 command.

maybe you were accident installing to a diff env?

@hteeyeoh
Copy link

Facing the same issue here: I was using an python3.10-alpine base image for my container application.
When I try to install onnxruntime,

[build 7/8] RUN pip install onnxruntime:
0.977 ERROR: Could not find a version that satisfies the requirement onnxruntime (from versions: none)
0.990 ERROR: No matching distribution found for onnxruntime

Any comment or suggestion for next steps?

@lucifiel1618
Copy link

Facing the same issue here: I was using an python3.10-alpine base image for my container application. When I try to install onnxruntime,

[build 7/8] RUN pip install onnxruntime:
0.977 ERROR: Could not find a version that satisfies the requirement onnxruntime (from versions: none)
0.990 ERROR: No matching distribution found for onnxruntime

Any comment or suggestion for next steps?

same for me with the official python3.11-alpine image

@hteeyeoh
Copy link

hteeyeoh commented Oct 2, 2024

Facing the same issue here: I was using an python3.10-alpine base image for my container application. When I try to install onnxruntime,

[build 7/8] RUN pip install onnxruntime:
0.977 ERROR: Could not find a version that satisfies the requirement onnxruntime (from versions: none)
0.990 ERROR: No matching distribution found for onnxruntime

Any comment or suggestion for next steps?

same for me with the official python3.11-alpine image

Seems like is because alpine linux does not support that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests