theredsix / cerebellum

Browser automation system that uses AI-driven planning to navigate web pages and perform goals.
MIT License
634 stars 32 forks source link

ImportError: cannot import name 'StrEnum' from 'enum' #11

Open Katehuuh opened 4 days ago

Katehuuh commented 4 days ago
Traceback (most recent call last):
  File "C:\browser-use\examples.py", line 2, in <module>
    from cerebellum import AnthropicPlanner, BrowserAgent, BrowserAgentOptions, pause_for_input
  File "C:\browser-use\venv\lib\site-packages\cerebellum\__init__.py", line 1, in <module>
    from .browser import *
  File "C:\browser-use\venv\lib\site-packages\cerebellum\browser.py", line 11, in <module>
    from enum import StrEnum
ImportError: cannot import name 'StrEnum' from 'enum' (C:\Python\Python310\lib\enum.py)

Python: 3.10.8

Error supposedly related to an older incompatible version. https://github.com/theredsix/cerebellum/blob/ce83dbe23fc97d7c88a8b739706bca54eed844ae/python/pyproject.toml#L52 Could this please be made retrocompatible to 3.10.x?


Additional suggestion: Support OpenAI-compatible endpoints OPENAI_API_KEY + OPENAI_API_BASE (useful for local LLM).

theredsix commented 1 day ago

@scm-aiml thoughts on the python backport?

scm-aiml commented 28 minutes ago

@theredsix this should be an easy fix, and should be able to support python 3.10. I will take a quick change and try just setting it like this https://github.com/theredsix/cerebellum/blob/ce83dbe23fc97d7c88a8b739706bca54eed844ae/python/src/cerebellum/browser.py#L90