Reputation: 95
My System has Win 7 64bit installed when I try to execute the below code I'm facing with the error "No module named win32com.client". Can anyone help me with that?
import wmi
c = wmi.WMI()
display = c.Win32_videocontroller
print display.properties
I'm using Python 2.7Ver
Error code:
Traceback (most recent call last): File "", line 1, in import wmi File "C:\Python27\lib\site-packages\wmi.py", line 88, in from win32com.client import GetObject, Dispatch
ImportError: No module named win32com.client
Upvotes: 6
Views: 48627
Reputation: 19644
As of 2020, Python 2 is unsupported.
Also, the package named pypiwin32
looks abandoned as it lags behind in version (221 vs 224) and lacks a description.
python -m pip install pywin32
works in Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32 on Windows 10, and Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)] on win32 on Windows 10 Pro, but if it doesn't for you:
python -m pip install pywin32
python %LOCALAPPDATA%\Programs\Python\Python312\Scripts\pywin32_postinstall.py -install
or thereabouts.Upvotes: -1
Reputation: 1187
UPDATE 2016
There is now a version of pywin32 on PyPI that can be installed with pip. It is called pypiwin32, and it installs the package using the binary wheel format.
https://pypi.python.org/pypi/pypiwin32
pip install pypiwin32
That will work in a virtualenv, or with tox, etc.
Upvotes: 12
Reputation: 370
You can google it.Visit this link and choose the right version to install on your computer。
Upvotes: 1