But the following PY code will work fine for other people using python in a non-JMP environment.
But I've never been successful running python in a JMP environment.Attempts to install different versions of these libraries also failed.
error
C:\Users\Administrator\AppData\Roaming\JMP\JMP\Python\Python311\site-packages\pywinauto\__init__.py:71: UserWarning: Apply externally defined coinit_flags: 2
warnings.warn("Apply externally defined coinit_flags: {0}"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Administrator\AppData\Roaming\JMP\JMP\Python\Python311\site-packages\pywinauto\__init__.py", line 89, in <module>
from . import findwindows
File "C:\Users\Administrator\AppData\Roaming\JMP\JMP\Python\Python311\site-packages\pywinauto\findwindows.py", line 42, in <module>
from . import controls
File "C:\Users\Administrator\AppData\Roaming\JMP\JMP\Python\Python311\site-packages\pywinauto\controls\__init__.py", line 36, in <module>
from . import uiawrapper # register "uia" back-end (at the end of uiawrapper module)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Roaming\JMP\JMP\Python\Python311\site-packages\pywinauto\controls\uiawrapper.py", line 47, in <module>
from ..uia_defines import IUIA
File "C:\Users\Administrator\AppData\Roaming\JMP\JMP\Python\Python311\site-packages\pywinauto\uia_defines.py", line 181, in <module>
pattern_ids = _build_pattern_ids_dic()
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Roaming\JMP\JMP\Python\Python311\site-packages\pywinauto\uia_defines.py", line 169, in _build_pattern_ids_dic
if hasattr(IUIA().ui_automation_client, cls_name):
^^^^^^
File "C:\Users\Administrator\AppData\Roaming\JMP\JMP\Python\Python311\site-packages\pywinauto\uia_defines.py", line 50, in __call__
cls._instances[cls] = super(_Singleton, cls).__call__(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Roaming\JMP\JMP\Python\Python311\site-packages\pywinauto\uia_defines.py", line 60, in __init__
self.UIA_dll = comtypes.client.GetModule('UIAutomationCore.dll')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Roaming\JMP\JMP\Python\Python311\site-packages\comtypes\client\_generate.py", line 153, in GetModule
return _create_friendly_module(tlib, modulename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Roaming\JMP\JMP\Python\Python311\site-packages\comtypes\client\_generate.py", line 218, in _create_friendly_module
_invalidate_import_caches()
File "C:\Users\Administrator\AppData\Roaming\JMP\JMP\Python\Python311\site-packages\comtypes\client\_generate.py", line 189, in _invalidate_import_caches
importlib.invalidate_caches()
File "importlib\__init__.py", line 70, in invalidate_caches
finder.invalidate_caches()
File "<frozen importlib._bootstrap_external>", line 1409, in invalidate_caches
TypeError: MetadataPathFinder.invalidate_caches() missing 1 required positional argument: 'cls'
PY
from pywinauto.application import Application
from pywinauto import timings
import pandas as pd
import time
import datetime
import os
import psutil