Search code examples
pythonmavenrobotframeworkattributeerrorpyautogui

AttributeError: 'module' object has no attribute '_keydown' in Maven project


I have problem with puautogui python library. But when I use the library in command line or in robot framework (without maven), then all works fine. But I get this problem when I use the library in robot framework in Maven project.

Do you know what should I do?

Python Code:

import pyautogui
pyautogui.typewrite('first')
pyautogui.typewrite(['down'])
pyautogui.typewrite(['enter'])

Solution

  • OK, it works now.. When maven unzipped the libraries to file, then compiled all library include pyautogui, and there should are created compiled files, and modules should have also module$py.class file. But the one (puautogui_win.py) doesn't. So in init.py I added import pyautogui.pyautogui_win but there was only import pyautogui.pyautogui_win as platformModule