Hi,
I’m trying to use RPA.Desktop.OperatingSystem library. Though while coding, all the methods under ‘Desktop’ shows up but when I execute the code, it is throwing the errors mentioned below. I’d really appreciate any help that I could get. Thanks in advance.
My code:
*** Settings ***
Library RPA.Desktop.OperatingSystem
*** Tasks ***
Get computer information
${machine}= Get Machine Name
Log ${machine}
ERROR:
Exception has occurred.
Suspended due to logged error: Error in file ‘c:\Azure\feature-dataquality-locations\aIT-RPA\Bots\Test\Test.robot’ on line 2: Importing library ‘RPA.Desktop.OperatingSystem’ failed: IndexError: list index out of range
Traceback (most recent call last):
File “C:\program files\python311\Lib\site-packages\RPA\Desktop_init_.py”, line 18, in
import pywinauto
File “C:\program files\python311\Lib\site-packages\pywinauto_init_.py”, line 89, in
from . import findwindows
File “C:\program files\python311\Lib\site-packages\pywinauto\findwindows.py”, line 42, in
from . import controls
File “C:\program files\python311\Lib\site-packages\pywinauto\controls_init_.py”, line 36, in
from . import uiawrapper # register “uia” back-end (at the end of uiawrapper module)
^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\program files\python311\Lib\site-packages\pywinauto\controls\uiawrapper.py”, line 47, in
from …uia_defines import IUIA
File “C:\program files\python311\Lib\site-packages\pywinauto\uia_defines.py”, line 181, in
pattern_ids = _build_pattern_ids_dic()
^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\program files\python311\Lib\site-packages\pywinauto\uia_defines.py”, line 169, in _build_pattern_ids_dic
if hasattr(IUIA().ui_automation_client, cls_name):
^^^^^^
File “C:\program files\python311\Lib\site-packages\pywinauto\uia_defines.py”, line 50, in call
cls._instances[cls] = super(_Singleton, cls).call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\program files\python311\Lib\site-packages\pywinauto\uia_defines.py”, line 60, in init
self.UIA_dll = comtypes.client.GetModule(‘UIAutomationCore.dll’)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\program files\python311\Lib\site-packages\comtypes\client_generate.py”, line 128, in GetModule
return ModuleGenerator(tlib, pathname).generate()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\program files\python311\Lib\site-packages\comtypes\client_generate.py”, line 244, in generate
GetModule(ext_tlib)
File “C:\program files\python311\Lib\site-packages\comtypes\client_generate.py”, line 128, in GetModule
return ModuleGenerator(tlib, pathname).generate()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\program files\python311\Lib\site-packages\comtypes\client_generate.py”, line 245, in generate
return [_create_module(name, code) for (name, code) in codebases][-1]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\program files\python311\Lib\site-packages\comtypes\client_generate.py”, line 245, in
return [_create_module(name, code) for (name, code) in codebases][-1]
^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\program files\python311\Lib\site-packages\comtypes\client_generate.py”, line 206, in _create_module
abs_gen_path = os.path.abspath(g.path[0]) # type: ignore
~~~~~~~~~~^^^
PYTHONPATH:
C:\Program Files\Python311
C:\program files\python311\Lib
C:\program files\python311\Lib\site-packages
c:\Users\vcharan.vscode\extensions\robocorp.robotframework-lsp-1.12.0\src\robotframework_debug_adapter
C:\Azure
c:\Users\vcharan.vscode\extensions\robocorp.robotframework-lsp-1.12.0\src
c:\Users\vcharan.vscode\extensions\robocorp.robotframework-lsp-1.12.0\src\robotframework_ls\vendored
C:\Program Files\Python311\python311.zip
C:\Program Files\Python311\DLLs
C:\Program Files\Python311\Lib
C:\Program Files\Python311
C:\Program Files\Python311\Lib\site-packages
C:\Program Files\Python311\Lib\site-packages\win32
C:\Program Files\Python311\Lib\site-packages\win32\lib
C:\Program Files\Python311\Lib\site-packages\Pythonwin