openatx / uiautomator2

Android Uiautomator2 Python Wrapper
MIT License
6.57k stars 1.4k forks source link

图像匹配报错 #854

Closed 1450687719 closed 5 months ago

1450687719 commented 1 year ago

执行以下代码报错: imdata = '7.png' # 也可以是URL, PIL.Image或OpenCV打开的图像 d.image.match('7.png')

报错内容为: Traceback (most recent call last): File "C:\Users\Ms.zhang\AppData\Local\Programs\Python\Python38\lib\code.py", line 90, in runcode exec(code, self.locals) File "", line 1, in File "D:\新建文件夹\PyCharm 2022.1\plugins\python\helpers\pydev_pydev_bundle\pydev_umd.py", line 198, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "D:\新建文件夹\PyCharm 2022.1\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "D:/pythonProject2/自动同花顺/open.py", line 15, in d.image.click(imdata, timeout=20.0) File "D:\pythonProject2\venv\lib\site-packages\cached_property.py", line 36, in get value = obj.dict[self.func.name] = self.func(obj) File "D:\pythonProject2\venv\lib\site-packages\uiautomator2__init.py", line 1840, in image from uiautomator2 import image as _image File "D:\新建文件夹\PyCharm 2022.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, kwargs) File "D:\pythonProject2\venv\lib\site-packages\uiautomator2\image.py", line 16, in import findit File "D:\新建文件夹\PyCharm 2022.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, *kwargs) File "D:\pythonProject2\venv\lib\site-packages\findit__init__.py", line 1, in from findit.core import FindIt File "D:\新建文件夹\PyCharm 2022.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, args, kwargs) File "D:\pythonProject2\venv\lib\site-packages\findit\core.py", line 11, in from findit.engine import engine_dict, FindItEngineResponse, FindItEngine File "D:\新建文件夹\PyCharm 2022.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, kwargs) File "D:\pythonProject2\venv\lib\site-packages\findit\engine__init__.py", line 1, in from findit.engine.feature import FeatureEngine File "D:\新建文件夹\PyCharm 2022.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, *kwargs) File "D:\pythonProject2\venv\lib\site-packages\findit\engine\feature.py", line 7, in from sklearn.cluster import KMeans File "D:\新建文件夹\PyCharm 2022.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, args, kwargs) File "D:\pythonProject2\venv\lib\site-packages\sklearn__init.py", line 64, in from .base import clone File "D:\新建文件夹\PyCharm 2022.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, kwargs) File "D:\pythonProject2\venv\lib\site-packages\sklearn\base.py", line 13, in from .utils.fixes import signature File "D:\新建文件夹\PyCharm 2022.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, *kwargs) File "D:\pythonProject2\venv\lib\site-packages\sklearn\utils__init__.py", line 14, in from . import _joblib File "D:\新建文件夹\PyCharm 2022.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, args, kwargs) File "D:\pythonProject2\venv\lib\site-packages\sklearn\utils_joblib.py", line 22, in from ..externals import joblib File "D:\新建文件夹\PyCharm 2022.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, kwargs) File "D:\pythonProject2\venv\lib\site-packages\sklearn\externals\joblib__init__.py", line 119, in from .parallel import Parallel File "D:\新建文件夹\PyCharm 2022.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, *kwargs) File "D:\pythonProject2\venv\lib\site-packages\sklearn\externals\joblib\parallel.py", line 28, in from ._parallel_backends import (FallbackToBackend, MultiprocessingBackend, File "D:\新建文件夹\PyCharm 2022.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, args, kwargs) File "D:\pythonProject2\venv\lib\site-packages\sklearn\externals\joblib_parallel_backends.py", line 22, in from .executor import get_memmapping_executor File "D:\新建文件夹\PyCharm 2022.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, *kwargs) File "D:\pythonProject2\venv\lib\site-packages\sklearn\externals\joblib\executor.py", line 14, in from .externals.loky.reusable_executor import get_reusable_executor File "D:\新建文件夹\PyCharm 2022.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, args, **kwargs) File "D:\pythonProject2\venv\lib\site-packages\sklearn\externals\joblib\externals\loky\init__.py", line 12, in from .backend.reduction import set_loky_pickler File "D:\新建文件夹\PyCharm 2022.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, *kwargs) File "D:\pythonProject2\venv\lib\site-packages\sklearn\externals\joblib\externals\loky\backend\reduction.py", line 125, in from sklearn.externals.joblib.externals import cloudpickle # noqa: F401 File "D:\新建文件夹\PyCharm 2022.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, args, **kwargs) File "D:\pythonProject2\venv\lib\site-packages\sklearn\externals\joblib\externals\cloudpickle\init__.py", line 3, in from .cloudpickle import File "D:\新建文件夹\PyCharm 2022.1\plugins\python\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, args, **kwargs) File "D:\pythonProject2\venv\lib\site-packages\sklearn\externals\joblib\externals\cloudpickle\cloudpickle.py", line 167, in _cell_set_template_code = _make_cell_set_template_code() File "D:\pythonProject2\venv\lib\site-packages\sklearn\externals\joblib\externals\cloudpickle\cloudpickle.py", line 148, in _make_cell_set_template_code return types.CodeType( TypeError: an integer is required (got type bytes)

gleke commented 1 year ago

你这是识别验证码?

codeskyblue commented 5 months ago

图片匹配从lib中移除,需要搞验证码可以试试 dddocr