microsoft / onnxruntime-genai

Generative AI extensions for onnxruntime

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Documentation Request] pip install onnxruntime-genai --pre command does not work

maxfridbe opened this issue · comments

pip install onnxruntime-genai --pre

results in

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

on ubuntu 20.04, which runs ollama just fine.


Document Details

What is the version of Python you're using?

Also, could you share the output of this in Python?

import platform
print(platform.machine())
print(platform.version())
print(platform.platform())
print(platform.system())
print(platform.processor())

Hello, any update here?

Python 3.8.10 (default, Nov 22 2023, 10:22:35) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> print(platform.machine())
x86_64
>>> print(platform.version())
#1 SMP PREEMPT_DYNAMIC Fri May 17 21:20:54 UTC 2024
>>> print(platform.platform())
Linux-6.8.10-300.fc40.x86_64-x86_64-with-glibc2.29
>>> print(platform.system())
Linux
>>> print(platform.processor())
x86_64

Could you please also try running this command and share the output?

python -m pip debug --verbose

╰─ pip debug --verbose
Traceback (most recent call last):
  File "/usr/bin/pip", line 11, in <module>
    load_entry_point('pip==20.0.2', 'console_scripts', 'pip')()
  File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 73, in main
    command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/__init__.py", line 96, in create_command
    module = importlib.import_module(module_path)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/pip/_internal/commands/debug.py", line 11, in <module>
    from pip._vendor.certifi import where
ModuleNotFoundError: No module named 'pip._vendor.certifi'

Not sure if this is a pip installation problem. From what I can tell, the onnxruntime-genai package should be available for your machine.

I'll ask internally to see if someone has any suggestions that may be helpful.

The suggestion I got was that this issue is related to the pip installation. Could you please try re-installing pip on your machine?

Hi i'm having the same issue trying to install on ios

>>> print(platform.machine())
x86_64
>>> print(platform.version())
Darwin Kernel Version 23.4.0: Fri Mar 15 00:11:05 PDT 2024; root:xnu-10063.101.17~1/RELEASE_X86_64
>>> print(platform.platform())
macOS-10.16-x86_64-i386-64bit
>>> print(platform.system())
Darwin
>>> print(platform.processor())
i386

On macOS it was because of conda. If you use the system's python, it will be fine.

so it cannot be installed in a virtual environment? i tried installing in system's python it doesn't work either

Python itself supports virtual environment. You don't have to use conda.

Well it doesn't work in the system's python either. getting the same error when running the install command python -m pip install onnxruntime-genai --pre

alphomeg we do not have mac wheels published yet. We plan on publishing mac wheels in the near future. In the meantime, please build from source for macos.

For the OP @maxfridbe, if you can get the python -m pip debug --verbose working in your environment, then we can see why pip can't find a distribution for your environment.

Updating here about the installation on intel chip MacBook with conda installed.

Complete Option 1 from here https://onnxruntime.ai/docs/genai/howto/build-from-source.html
commented all conda related code in .zshrc
open terminal and type which python3 to confirm, it should give the system installed python path
now from inside onnxruntime-genai folder, run python3 build.py

in my case anaconda didn't let me install even though commented everything from .zshrc, what I did is log in to mac as another user followed the above steps and switch back user.

Glad to hear you solved your issue. Please stay tuned for publishing mac packages.