首页 > 其他分享 >pywin32和wmi的安装和测试

pywin32和wmi的安装和测试

时间:2022-12-06 22:25:18浏览次数:60  
标签:macaddress name Madking pywin32 pyAPP wmi 测试 model ipaddress


E:\pyAPP\Madking\MadKingClient>python bin\NedStark.py collect_data
E:\pyAPP\Madking\MadKingClient
Traceback (most recent call last):
File "E:\pyAPP\Madking\MadKingClient\bin\NedStark.py", line 26, in <module>
HouseStark.ArgvHandler(sys.argv)
File "E:\pyAPP\Madking\MadKingClient\core\HouseStark.py", line 24, in __init__
self.parse_argv()
File "E:\pyAPP\Madking\MadKingClient\core\HouseStark.py", line 30, in parse_argv
func()
File "E:\pyAPP\Madking\MadKingClient\core\HouseStark.py", line 48, in collect_data
asset_data = obj.collect()
File "E:\pyAPP\Madking\MadKingClient\core\info_collection.py", line 32, in collect
info_data = func()
File "E:\pyAPP\Madking\MadKingClient\core\info_collection.py", line 44, in Windows
sys_info = plugin_api.WindowsSysInfo()
File "E:\pyAPP\Madking\MadKingClient\plugins\plugin_api.py", line 19, in WindowsSysInfo
from plugins.windows import sysinfo as win_sysinfo
File "E:\pyAPP\Madking\MadKingClient\plugins\windows\sysinfo.py", line 11, in <module>
import win32com
ModuleNotFoundError: No module named 'win32com'

E:\pyAPP\Madking\MadKingClient>pip install pywin32com
ERROR: Could not find a version that satisfies the requirement pywin32com (from versions: none)
ERROR: No matching distribution found for pywin32com
WARNING: You are using pip version 22.0.4; however, version 22.3.1 is available.
You should consider upgrading via the 'D:\Python\Python310\python.exe -m pip install --upgrade pip' command.

E:\pyAPP\Madking\MadKingClient>pip install pywin32
Collecting pywin32
Using cached pywin32-305-cp310-cp310-win_amd64.whl (12.1 MB)
Installing collected packages: pywin32
Successfully installed pywin32-305
WARNING: You are using pip version 22.0.4; however, version 22.3.1 is available.
You should consider upgrading via the 'D:\Python\Python310\python.exe -m pip install --upgrade pip' command.

E:\pyAPP\Madking\MadKingClient>python bin\NedStark.py collect_data
E:\pyAPP\Madking\MadKingClient
Traceback (most recent call last):
File "E:\pyAPP\Madking\MadKingClient\bin\NedStark.py", line 26, in <module>
HouseStark.ArgvHandler(sys.argv)
File "E:\pyAPP\Madking\MadKingClient\core\HouseStark.py", line 24, in __init__
self.parse_argv()
File "E:\pyAPP\Madking\MadKingClient\core\HouseStark.py", line 30, in parse_argv
func()
File "E:\pyAPP\Madking\MadKingClient\core\HouseStark.py", line 48, in collect_data
asset_data = obj.collect()
File "E:\pyAPP\Madking\MadKingClient\core\info_collection.py", line 32, in collect
info_data = func()
File "E:\pyAPP\Madking\MadKingClient\core\info_collection.py", line 44, in Windows
sys_info = plugin_api.WindowsSysInfo()
File "E:\pyAPP\Madking\MadKingClient\plugins\plugin_api.py", line 19, in WindowsSysInfo
from plugins.windows import sysinfo as win_sysinfo
File "E:\pyAPP\Madking\MadKingClient\plugins\windows\sysinfo.py", line 12, in <module>
import wmi
ModuleNotFoundError: No module named 'wmi'

E:\pyAPP\Madking\MadKingClient>pip install wmi
Collecting wmi
Using cached WMI-1.5.1-py2.py3-none-any.whl (28 kB)
Requirement already satisfied: pywin32 in d:\python\python310\lib\site-packages (from wmi) (305)
Installing collected packages: wmi
Successfully installed wmi-1.5.1
WARNING: You are using pip version 22.0.4; however, version 22.3.1 is available.
You should consider upgrading via the 'D:\Python\Python310\python.exe -m pip install --upgrade pip' command.

E:\pyAPP\Madking\MadKingClient>python bin\NedStark.py collect_data
E:\pyAPP\Madking\MadKingClient
{'os_type': 'Windows', 'os_release': '10 64bit 10.0.19044 ', 'os_distribution': 'Microsoft', 'asset_type': 'server', 'cpu_count': 1, 'cpu_model': 'Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz', 'cpu_core_count': 6, 'ram': [{'slot': 'DIMM A', 'capacity': 8192.0, 'model': '物理内存', 'manufactory': '80AD000080AD', 'sn': '72D9F1A2'}, {'slot': 'DIMM B', 'capacity': 8192.0, 'model': '物理内存', 'manufactory': '80AD000080AD', 'sn': '72D9F135'}], 'manufactory': 'Dell Inc.', 'model': 'G7 7590', 'wake_up_type': 6, 'sn': '00330-80000-00000-AA305', 'physical_disk_driver': [{'iface_type': 'unknown', 'slot': 0, 'sn': '0000_0000_0000_0001_8CE3_8E05_0007_2F85.', 'model': 'NVMe KXG60ZNV1T02 NVM', 'manufactory': '(标准磁盘驱动器)', 'capacity': 953.8639712333679}], 'nic': [{'macaddress': '8C:04:BA:99:70:5E', 'model': '[00000001] Killer E2500 Gigabit Ethernet Controller', 'name': 1, 'ipaddress': '', 'netmask': ''}, {'macaddress': 'A8:6D:AA:52:E3:6F', 'model': '[00000003] Killer(R) Wireless-AC 1550 Wireless Network Adapter (9260NGW) 160MHz', 'name': 3, 'ipaddress': '192.168.43.141', 'netmask': ('255.255.255.0', '64', '128', '64')}, {'macaddress': '00:50:56:C0:00:01', 'model': '[00000004] VMware Virtual Ethernet Adapter for VMnet1', 'name': 4, 'ipaddress': '169.254.155.251', 'netmask': ('255.255.0.0', '64')}, {'macaddress': '00:50:56:C0:00:08', 'model': '[00000005] VMware Virtual Ethernet Adapter for VMnet8', 'name': 5, 'ipaddress': '169.254.193.136', 'netmask': ('255.255.0.0', '64')}, {'macaddress': 'FE:45:20:52:41:53', 'model': '[00000011] WAN Miniport (IP)', 'name': 11, 'ipaddress': '', 'netmask': ''}, {'macaddress': '0C:CC:20:52:41:53', 'model': '[00000012] WAN Miniport (IPv6)', 'name': 12, 'ipaddress': '', 'netmask': ''}, {'macaddress': '18:6C:20:52:41:53', 'model': '[00000013] WAN Miniport (Network Monitor)', 'name': 13, 'ipaddress': '', 'netmask': ''}, {'macaddress': 'A8:6D:AA:52:E3:70', 'model': '[00000014] Microsoft Wi-Fi Direct Virtual Adapter', 'name': 14, 'ipaddress': '', 'netmask': ''}, {'macaddress': 'AA:6D:AA:52:E3:6F', 'model': '[00000015] Microsoft Wi-Fi Direct Virtual Adapter', 'name': 15, 'ipaddress': '', 'netmask': ''}, {'macaddress': '0A:00:27:00:00:13', 'model': '[00000016] VirtualBox Host-Only Ethernet Adapter', 'name': 16, 'ipaddress': '192.168.56.1', 'netmask': ('255.255.255.0', '64')}, {'macaddress': 'A8:6D:AA:52:E3:73', 'model': '[00000017] Bluetooth Device (Personal Area Network)', 'name': 17, 'ipaddress': '', 'netmask': ''}, {'macaddress': '00:15:5D:98:9F:6C', 'model': '[00000019] Hyper-V Virtual Ethernet Adapter', 'name': 19, 'ipaddress': '192.168.64.1', 'netmask': ('255.255.240.0', '64')}]}
{'os_type': 'Windows', 'os_release': '10 64bit 10.0.19044 ', 'os_distribution': 'Microsoft', 'asset_type': 'server', 'cpu_count': 1, 'cpu_model': 'Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz', 'cpu_core_count': 6, 'ram': [{'slot': 'DIMM A', 'capacity': 8192.0, 'model': '物理内存', 'manufactory': '80AD000080AD', 'sn': '72D9F1A2'}, {'slot': 'DIMM B', 'capacity': 8192.0, 'model': '物理内存', 'manufactory': '80AD000080AD', 'sn': '72D9F135'}], 'manufactory': 'Dell Inc.', 'model': 'G7 7590', 'wake_up_type': 6, 'sn': '00330-80000-00000-AA305', 'physical_disk_driver': [{'iface_type': 'unknown', 'slot': 0, 'sn': '0000_0000_0000_0001_8CE3_8E05_0007_2F85.', 'model': 'NVMe KXG60ZNV1T02 NVM', 'manufactory': '(标准磁盘驱动器)', 'capacity': 953.8639712333679}], 'nic': [{'macaddress': '8C:04:BA:99:70:5E', 'model': '[00000001] Killer E2500 Gigabit Ethernet Controller', 'name': 1, 'ipaddress': '', 'netmask': ''}, {'macaddress': 'A8:6D:AA:52:E3:6F', 'model': '[00000003] Killer(R) Wireless-AC 1550 Wireless Network Adapter (9260NGW) 160MHz', 'name': 3, 'ipaddress': '192.168.43.141', 'netmask': ('255.255.255.0', '64', '128', '64')}, {'macaddress': '00:50:56:C0:00:01', 'model': '[00000004] VMware Virtual Ethernet Adapter for VMnet1', 'name': 4, 'ipaddress': '169.254.155.251', 'netmask': ('255.255.0.0', '64')}, {'macaddress': '00:50:56:C0:00:08', 'model': '[00000005] VMware Virtual Ethernet Adapter for VMnet8', 'name': 5, 'ipaddress': '169.254.193.136', 'netmask': ('255.255.0.0', '64')}, {'macaddress': 'FE:45:20:52:41:53', 'model': '[00000011] WAN Miniport (IP)', 'name': 11, 'ipaddress': '', 'netmask': ''}, {'macaddress': '0C:CC:20:52:41:53', 'model': '[00000012] WAN Miniport (IPv6)', 'name': 12, 'ipaddress': '', 'netmask': ''}, {'macaddress': '18:6C:20:52:41:53', 'model': '[00000013] WAN Miniport (Network Monitor)', 'name': 13, 'ipaddress': '', 'netmask': ''}, {'macaddress': 'A8:6D:AA:52:E3:70', 'model': '[00000014] Microsoft Wi-Fi Direct Virtual Adapter', 'name': 14, 'ipaddress': '', 'netmask': ''}, {'macaddress': 'AA:6D:AA:52:E3:6F', 'model': '[00000015] Microsoft Wi-Fi Direct Virtual Adapter', 'name': 15, 'ipaddress': '', 'netmask': ''}, {'macaddress': '0A:00:27:00:00:13', 'model': '[00000016] VirtualBox Host-Only Ethernet Adapter', 'name': 16, 'ipaddress': '192.168.56.1', 'netmask': ('255.255.255.0', '64')}, {'macaddress': 'A8:6D:AA:52:E3:73', 'model': '[00000017] Bluetooth Device (Personal Area Network)', 'name': 17, 'ipaddress': '', 'netmask': ''}, {'macaddress': '00:15:5D:98:9F:6C', 'model': '[00000019] Hyper-V Virtual Ethernet Adapter', 'name': 19, 'ipaddress': '192.168.64.1', 'netmask': ('255.255.240.0', '64')}]}

E:\pyAPP\Madking\MadKingClient>

标签:macaddress,name,Madking,pywin32,pyAPP,wmi,测试,model,ipaddress
From: https://www.cnblogs.com/beichengshiqiao/p/16960836.html

相关文章