Skip to content

拉取最新代码,运行webui服务出现gradio6.0不兼容问题导致服务运行失败 #25

@owen202402

Description

@owen202402

当前的系统是win11 x64,python是3.12.9 x64
env_python_module_version_gradio_6.2.0.txt

(.venv) E:\Project\github_code\mobile-use>python -m mobile_use.webui
E:\Project\github_code\mobile-use\mobile_use\webui.py:316: UserWarning: The parameters have been moved from the Blocks constructor to the launch() method in Gradio 6.0: theme. Please pass these parameters to launch() instead.
with gr.Blocks(title="Mobile Use WebUI", theme=gr.themes.Default()) as demo:
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "E:\Project\github_code\mobile-use\mobile_use\webui.py", line 522, in
demo = build_agent_ui_demo()
^^^^^^^^^^^^^^^^^^^^^
File "E:\Project\github_code\mobile-use\mobile_use\webui.py", line 461, in build_agent_ui_demo
chatbot = gr.Chatbot(
^^^^^^^^^^^
File "E:\Project\github_code\mobile-use.venv\Lib\site-packages\gradio\component_meta.py", line 194, in wrapper
return fn(self, **kwargs)
^^^^^^^^^^^^^^^^^^
TypeError: Chatbot.init() got an unexpected keyword argument 'type'

按照ai提示,删除env之后,重新安装配置环境,通过pyproject.toml将gradio锁定为5.10.0版本,然后重建env再安装,又出现新的不匹配问题
(.venv) E:\Project\github_code\mobile-use>python -m mobile_use.webui
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "E:\Project\github_code\mobile-use\mobile_use\webui.py", line 521, in
demo = build_agent_ui_demo()
^^^^^^^^^^^^^^^^^^^^^
File "E:\Project\github_code\mobile-use\mobile_use\webui.py", line 335, in build_agent_ui_demo
port = gr.Number(
^^^^^^^^^^
File "E:\Project\github_code\mobile-use.venv\Lib\site-packages\gradio\component_meta.py", line 179, in wrapper
return fn(self, **kwargs)
^^^^^^^^^^^^^^^^^^
TypeError: Number.init() got an unexpected keyword argument 'placeholder'

同上边的操作,降级gradio版本到3.48.0:
env_python_module_version_gradio_3.48.0.txt

(.venv) E:\Project\github_code\mobile-use>python -m mobile_use.webui
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "E:\Project\github_code\mobile-use\mobile_use\webui.py", line 13, in
from gradio import ChatMessage
ImportError: cannot import name 'ChatMessage' from 'gradio' (E:\Project\github_code\mobile-use.venv\Lib\site-packages\gradio_init
.py)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions