Traceback (most recent call last): File "D:\新建文件夹\AutoStrike-main\auto_strike.py", line 454, in <module> main() File "D:\新建文件夹\AutoStrike-main\auto_strike.py", line 443, in main app.control() File "D:\新建文件夹\AutoStrike-main\auto_strike.py", line 347, in control self.move_func, self.mouse_left_click, self.key_click = select_device(self.device) File "D:\新建文件夹\AutoStrike-main\auto_strike.py", line 104, in select_device from tools.mouse.logitech_km import mouse_move_relative, mouse_left_click, key_click File "D:\新建文件夹\AutoStrike-main\tools\mouse\logitech_km.py", line 4, in <module> from .send_input_dll import key_click File "D:\新建文件夹\AutoStrike-main\tools\mouse\send_input_dll.py", line 11, in <module> class SendInputDll(metaclass=make_dll_meta(DLL)): File "D:\新建文件夹\AutoStrike-main\tools\dll_meta.py", line 24, in __new__ dll = cdll.LoadLibrary(dll_path) File "D:\Anacond\envs\Ai2\lib\ctypes\__init__.py", line 447, in LoadLibrary return self._dlltype(name) File "D:\Anacond\envs\Ai2\lib\ctypes\__init__.py", line 369, in __init__ self._handle = _dlopen(self._name, mode) FileNotFoundError: Could not find module 'D:\新建文件夹\AutoStrike-main\tools\mouse\libsendinput.dll'. Try using the full path with constructor syntax.这个报错怎么解决
时间: 2023-07-21 18:44:15 浏览: 129
这个错误是因为程序无法找到 'D:\新建文件夹\AutoStrike-main\tools\mouse\libsendinput.dll' 这个文件。你可以尝试以下几种方法来解决这个问题:
1. 确认该文件是否存在于指定路径下,如果不存在,可以从其他地方获取该文件,或者重新编译该文件。
2. 尝试使用完整路径名来加载该文件,例如:
dll_path = r'D:\新建文件夹\AutoStrike-main\tools\mouse\libsendinput.dll'
dll = cdll.LoadLibrary(dll_path)
3. 如果你使用的是 Python 3.8 或以上版本,可以使用 pathlib 模块来构造完整路径名,例如:
from pathlib import Path
dll_path = Path('D:\新建文件夹\AutoStrike-main\tools\mouse\libsendinput.dll')
dll = cdll.LoadLibrary(str(dll_path.resolve()))
希望以上方法能够帮助你解决问题。
阅读全文