web-ui icon indicating copy to clipboard operation
web-ui copied to clipboard

ImportError: cannot import name 'AgentStepErrorTelemetryEvent'

Open KshitijAng opened this issue 1 year ago • 12 comments

I followed all the instructions in Option 1 and whne it came to running python webui.py --ip 127.0.0.1 --port 7788, this came up:

INFO     [browser_use] BrowserUse logging setup complete with level info
INFO     [root] Anonymized telemetry enabled. See https://github.com/gregpr07/browser-use for more information.
Traceback (most recent call last):
  File "/Users/kshitija/Desktop/skills/web-ui/webui.py", line 35, in <module>
    from src.agent.custom_agent import CustomAgent
  File "/Users/kshitija/Desktop/skills/web-ui/src/agent/custom_agent.py", line 29, in <module>
    from browser_use.telemetry.views import (
ImportError: cannot import name 'AgentStepErrorTelemetryEvent' from 'browser_use.telemetry.views' (/Users/kshitija/Desktop/skills/web-ui/.venv/lib/python3.11/site-packages/browser_use/telemetry/views.py)```

KshitijAng avatar Jan 13 '25 07:01 KshitijAng

same issue

agn-7 avatar Jan 13 '25 08:01 agn-7

pip install browser-use==0.1.18, maybe browser-use have updated

vvincent1234 avatar Jan 13 '25 08:01 vvincent1234

same issue

iioodii avatar Jan 13 '25 09:01 iioodii

me too

xFerdino avatar Jan 13 '25 10:01 xFerdino

pip install browser-use==0.1.18

vvincent1234 avatar Jan 13 '25 10:01 vvincent1234

same issue

byliu avatar Jan 13 '25 10:01 byliu

downgrading pip install browser-use==0.1.18 did not appear to fix the issue, unfortunately. used both install methods, using uv,conda and docker environments, had issues with installation of playwright as well, had to update and manually install a few dependencies. Using native Ubuntu 24.04 (KUbuntu)

aggiegel avatar Jan 13 '25 11:01 aggiegel

not sure why this worked as I'm unfamiliar with the uv environemnt ecosystem, but trying "uv pip install browser-use==0.1.18" from within the environment got it up and running. I can also confirm the issue arose with latest browser-use version 0.1.21

aggiegel avatar Jan 13 '25 11:01 aggiegel

Yes I can have tried uv pip install browser-use==0.1.18 and it works but now I am stuck at this when I start the serach:

INFO     [agent] 
📍 Step 1
ERROR    [agent] ❌ Result failed 1/3 times:
 Connection error.
INFO     [agent] 
📍 Step 1
ERROR    [agent] ❌ Result failed 2/3 times:
 Connection error.
INFO     [agent] 
📍 Step 1
ERROR    [agent] ❌ Result failed 3/3 times:
 Connection error.
ERROR    [agent] ❌ Stopping due to 3 consecutive failures
INFO     [agent] Created GIF at agent_history.gif 
INFO     [src.agent.custom_agent] 🚀 Starting task: go to google.com and type 'OpenAI' click search and give me the first url
INFO     [src.agent.custom_agent] 
📍 Step 1
ERROR    [agent] ❌ Result failed 1/5 times:
 Connection error.
INFO     [src.agent.custom_agent] 
📍 Step 1
ERROR    [agent] ❌ Result failed 2/5 times:
 Connection error.
INFO     [src.agent.custom_agent] 
📍 Step 1
ERROR    [agent] ❌ Result failed 3/5 times:
 Connection error.
INFO     [src.agent.custom_agent] 
📍 Step 1
ERROR    [agent] ❌ Result failed 4/5 times:
 Connection error.
INFO     [src.agent.custom_agent] 
📍 Step 1
ERROR    [agent] ❌ Result failed 5/5 times:
 Connection error.
ERROR    [agent] ❌ Stopping due to 5 consecutive failures
INFO     [src.agent.custom_agent] Created GIF at agent_history.gif
^CKeyboard interruption in main thread... closing server.
WARNING  [browser] Failed to force close browser context: : Event loop is closed
Future exception was never retrieved
future: <Future finished exception=Exception('Connection closed while reading from the driver')>
Exception: Connection closed while reading from the driver
WARNING  [browser] Failed to force close browser context: : Event loop is closed
Future exception was never retrieved
future: <Future finished exception=Exception('Connection closed while reading from the driver')>
Exception: Connection closed while reading from the driver```

Can anyone help? Also when I select `Use Own Browser` option, it opens a blank Chrome window with nothing going on.

KshitijAng avatar Jan 13 '25 14:01 KshitijAng

show me the settings on your WebUI

warmshao avatar Jan 13 '25 14:01 warmshao

show me the settings on your WebUI

Do you mean the webui.py file?

KshitijAng avatar Jan 13 '25 14:01 KshitijAng

pip install browser-use==0.1.18

Rccustevens avatar Jan 14 '25 02:01 Rccustevens