Midscene-Python icon indicating copy to clipboard operation
Midscene-Python copied to clipboard

python3.10, 报错type' object is not subscriptable

Open xhongyan opened this issue 1 year ago • 1 comments

\Midscene-Python\midscene\android\agent.py", line 11, in class AndroidAgent(Agent[AndroidDevice]): TypeError: 'type' object is not subscriptable

xhongyan avatar Sep 06 '25 09:09 xhongyan

Python3.13.2运行有类似的问题,需要在core/agent.py中添加几行代码,就可以运行了

from typing import Generic, TypeVar

# 定义类型变量
T = TypeVar('T')

class Agent(Generic[T]):
...

mowen0107 avatar Dec 04 '25 02:12 mowen0107