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

This stopped working and now throws No module named 'urllib3' #9

Closed
ibehnam opened this issue May 3, 2024 · 4 comments
Closed

This stopped working and now throws No module named 'urllib3' #9

ibehnam opened this issue May 3, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@ibehnam
Copy link

ibehnam commented May 3, 2024

This used to work until about a month ago when it suddenly stopped working. This is the error I'm getting:

✨ llm keys set openrouter                                                                                                                  18:20:45
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.13.1_1/libexec/lib/python3.12/site-packages/llm/__init__.py", line 18, in <module>
    from .plugins import pm
  File "/opt/homebrew/Cellar/llm/0.13.1_1/libexec/lib/python3.12/site-packages/llm/plugins.py", line 17, in <module>
    pm.load_setuptools_entrypoints("llm")
  File "/opt/homebrew/Cellar/llm/0.13.1_1/libexec/lib/python3.12/site-packages/pluggy/_manager.py", line 414, in load_setuptools_entrypoints
    plugin = ep.load()
             ^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/metadata/__init__.py", line 205, in load
    module = import_module(match.group('module'))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.12/3.12.3/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.13.1_1/libexec/lib/python3.12/site-packages/llm_openrouter.py", line 7, in <module>
    import urllib3
ModuleNotFoundError: No module named 'urllib3'
@ibehnam
Copy link
Author

ibehnam commented May 3, 2024

Solved by llm install urllib3. Didn't know we could install Python dependencies through llm, but your workaround regarding Homebrew limitations made me think of this solution. pipx wouldn't let me install urllib3, saying that it's not a dependency for any package.

@simonw simonw added the bug Something isn't working label May 3, 2024
@simonw
Copy link
Owner

simonw commented May 3, 2024

Thanks for the bug report, maybe this is a Python 3.12 thing? I'll add urllib3 as a direct dependency (once I recreate the bug).

@ibehnam
Copy link
Author

ibehnam commented May 3, 2024

@simonw Yes, it's Python 3.12. The bug actually was worse than I thought because once it happens, also messes with the other functionality of llm as well. Had to pipx uninstall it a few times as it wouldn't let me set the API keys either.

@simonw
Copy link
Owner

simonw commented May 3, 2024

Actually I had a fix for this already, I just hadn't pushed it yet.

@simonw simonw closed this as completed May 3, 2024
simonw added a commit that referenced this issue May 3, 2024
Refs #4, #7, #8, #9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants