I checked with
jmputils.jpip('list')
mitmproxy was successfully installed
But it doesn't work in python code.
Thanks!
Doesn't work in what way? Does import mitmproxy fail? If so try restarting JMP and seeing if it's now visible to JMP. Otherwise how about an example? What have you tried and why doesn't it do what you are expecting?
Note to all: The package mitmproxy is a Man-In-the-Middle HTTPS/TLS web proxy for intercepting web traffic. I'm assuming the use case here is separately launched mitmproxy and use of JMP and mitmproxy's Python-API to control the proxy from JMP.
Yes, I want to use this mitmproxy to replace Selenium for packet capture.Maybe I have not set up the computer proxy server cause.And python is written by GPT-4o.I'll check first.
Thanks Experts!
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
There are specific python code files.
Attempts to install different versions of these libraries also failed.
As has been mentioned a couple of times in some of the other Python discussion posts, there is an issue in JMP 18.0 installing some packages. If the install fails due to a _socket cannot be found error, this is a known issue. It has been resolved in 18.1, but you need to do an uninstall of JMP 18.0 and a clean install of 18.1. The update / repair does not move the necessary files.
The workaround in 18.0 is to go to the JMP install directory create a DLLs\ directory, move all the .pyd into the DLLs directory and some dlls. These are: libcrypto, libssl, libffi, and sqlite3. They have version numbers in the name. Move these files to the DLLs directory as well. This should fix the failure to install due to the can't find _socket error. pywinauto should install after that fix or by reinstalling using 18.1