Addressing ImportError in Browser-Use WebUI

Overview


This note addresses an issue encountered when running Browser-Use WebUI on a Windows environment, resulting in the following error:
ImportError: cannot import name 'AgentStepErrorTelemetryEvent' from 'browser_use.telemetry.views'
    

Background

This issue arises because the module browser_use.telemetry.views used within the Browser-Use WebUI repository's source code does not align with the latest version's interface.

Temporary Solution

Reinstalling the specified version of the browser-use package as shown below temporarily resolves the issue:

uv pip install browser-use==0.1.18
    

Steps for Temporary Resolution

Prerequisites

  • Python 3.11 or higher (tested with 3.12.8)
  • uv
  • Windows 11 (tested environment)

Procedure

  1. Clone or download the repository into a created folder:

    git clone https://github.com/browser-use/web-ui.git .
                
  2. Create a virtual environment:

    uv venv --python 3.12
    .venv\Scripts\activate
                
  3. Install the necessary packages:

    uv pip install browser-use==0.1.18
    playwright install
    uv pip install -r requirements.txt
                
  4. Set environment variables by creating a .env file and configuring the required API keys and browser paths.

  5. Start the application:

    python webui.py --ip 127.0.0.1 --port 7788
                

    Access http://127.0.0.1:7788 in your browser to confirm the tool is running.

Conclusion

The encountered issue with Browser-Use WebUI was resolved by addressing the package version conflict. I hope this information is helpful to others facing similar challenges.

Comments