Skip to content

Homebrew release can't install plugins that use PyTorch (no PyTorch for Python 3.12 yet) #315

Description

@jernst

macOS Sonoma 14.0, M1 Pro

$ brew install llm
<skipped, no issues>
$ llm
Traceback (most recent call last):
  File "/opt/homebrew/bin/llm", line 5, in <module>
    from llm.cli import cli
  File "/opt/homebrew/Cellar/llm/0.11_1/libexec/lib/python3.12/site-packages/llm/__init__.py", line 18, in <module>
    from .plugins import pm
  File "/opt/homebrew/Cellar/llm/0.11_1/libexec/lib/python3.12/site-packages/llm/plugins.py", line 37, in <module>
    mod = importlib.import_module(plugin)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.0/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/llm/0.11_1/libexec/lib/python3.12/site-packages/llm/default_plugins/openai_models.py", line 6, in <module>
    import openai
  File "/opt/homebrew/Cellar/llm/0.11_1/libexec/lib/python3.12/site-packages/openai/__init__.py", line 19, in <module>
    from openai.api_resources import (
  File "/opt/homebrew/Cellar/llm/0.11_1/libexec/lib/python3.12/site-packages/openai/api_resources/__init__.py", line 1, in <module>
    from openai.api_resources.audio import Audio  # noqa: F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/llm/0.11_1/libexec/lib/python3.12/site-packages/openai/api_resources/audio.py", line 4, in <module>
    from openai import api_requestor, util
  File "/opt/homebrew/Cellar/llm/0.11_1/libexec/lib/python3.12/site-packages/openai/api_requestor.py", line 24, in <module>
    import requests
  File "/opt/homebrew/Cellar/llm/0.11_1/libexec/lib/python3.12/site-packages/requests/__init__.py", line 147, in <module>
    from . import packages, utils
  File "/opt/homebrew/Cellar/llm/0.11_1/libexec/lib/python3.12/site-packages/requests/utils.py", line 24, in <module>
    from . import certs
  File "/opt/homebrew/Cellar/llm/0.11_1/libexec/lib/python3.12/site-packages/requests/certs.py", line 14, in <module>
    from certifi import where
ModuleNotFoundError: No module named 'certifi'

If I go and run:

$ brew install python-certifi

and try again:

$ llm
Traceback (most recent call last):
  File "/opt/homebrew/bin/llm", line 5, in <module>
    from llm.cli import cli
  File "/opt/homebrew/Cellar/llm/0.11_1/libexec/lib/python3.12/site-packages/llm/__init__.py", line 18, in <module>
    from .plugins import pm
  File "/opt/homebrew/Cellar/llm/0.11_1/libexec/lib/python3.12/site-packages/llm/plugins.py", line 37, in <module>
    mod = importlib.import_module(plugin)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.0/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/llm/0.11_1/libexec/lib/python3.12/site-packages/llm/default_plugins/openai_models.py", line 17, in <module>
    import yaml
ModuleNotFoundError: No module named 'yaml'

So I do:

$ brew install pyyaml

and now we are in business.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions