Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WMI module help?
#1
I am using Windows 10 Home, 64-bit operating system and have installed python from https://www.python.org/downloads/. My python version is Python 3.6.1rc1 (v3.6.1rc1^0:e0fbe5feee4f9c00f09eb9659c2182183036261a, Mar  4 2017, 20:00:12) [MSC v.1900 64 bit (AMD64)] on win32. I wanted to use the import wmi command but I keep getting the following error-
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import wmi
  File "C:\Users\Aryan\AppData\Local\Programs\Python\Python36\lib\site-packages\wmi.py", line 88, in <module>
    from win32com.client import GetObject, Dispatch
ModuleNotFoundError: No module named 'win32com'
 
I installed wmi from https://pypi.python.org/pypi/WMI/ and the files name was WMI-1.4.9.win32.exe (md5).  After doing some research I found that you need the pywin module. I downloaded the pywin module from https://sourceforge.net/projects/pywin32/files/pywin32/Build%20220/ which was Build 220. The files name was pywin32-220.win-amd64-py3.6.exe 2016-01-11. I downloaded it but cannot install it. The error coming was called “Python version 3.6-32 required, which was not found in the registry.” What should I do?
I am trying to get the temperature of my cpu via the Open Hardware Monitor software for which I believe I need to use wmi.
Reply
#2
Use wheel from Gohlke
pip install pywin32‑221‑cp36‑cp36m‑win_amd64.whl
Reply
#3
Lol, I am stupid. I just realized that I downloaded the 32bit pywin for 64bit python

Can someone tell where I can find the 64bit build for pywin32 for Python 3.6.1rc1 (v3.6.1rc1^0:e0fbe5feee4f9c00f09eb9659c2182183036261a, Mar  4 2017, 20:00:12) [MSC v.1900 64 bit (AMD64)] on win32?
Reply
#4
Look at snippsat's post (same thread) he just told you where to get the wheel
Reply
#5
Yeah, so I installed the 64 bit pywin32 package, but whenever I enter "import wmi" in the Python IDLE, I am getting this error-

Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import wmi
File "C:\Users\Aryan\AppData\Local\Programs\Python\Python36\lib\site-packages\wmi.py", line 88, in <module>
from win32com.client import GetObject, Dispatch
File "C:\Users\Aryan\AppData\Local\Programs\Python\Python36\lib\site-packages\win32com\__init__.py", line 5, in <module>
import win32api, sys, os
ImportError: DLL load failed: The specified module could not be found.

I don't know what this is supposed to mean
Reply
#6
Run pip install as administrator cmd
Then  you most run post install(for DLL) see on Gohlke:
Quote:PyWin32 provides extensions for Windows.
To install pywin32 system files, run python.exe Scripts\pywin32_postinstall.py -install from an elevated command prompt.
Then for you as Python 36 install to a stupid path bye default(i would change).
python C:\Users\Aryan\AppData\Local\Programs\Python\Scripts\pywin32_postinstall.py -install
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020