6

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

SMR
  • 6,568
  • 2
  • 34
  • 56
Madhu
  • 95
  • 1
  • 1
  • 6
  • 2
    try `pip install pywin32` – Kobi K Nov 02 '15 at 06:33
  • 1
    Possible [duplicate](http://stackoverflow.com/questions/23864234/importerror-no-module-named-win32com-client). – ako Nov 02 '15 at 06:48
  • Possible duplicate of [ImportError: No module named win32com.client](https://stackoverflow.com/questions/23864234/importerror-no-module-named-win32com-client) – Cees Timmerman Dec 14 '18 at 18:37

4 Answers4

12

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.

M.S. Arun
  • 773
  • 10
  • 21
1

You can google it.Visit this link and choose the right version to install on your computer。

Akshay
  • 2,490
  • 4
  • 34
  • 52
veekxt
  • 196
  • 6
0

Go To this link

Then use

$python setup.py install
AB Abhi
  • 2,476
  • 22
  • 30
-1

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:

Install the pywin32 package:

  1. Start a command line with admin rights.
  2. python -m pip install pywin32
  3. python C:\Users\Cees\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Scripts\pywin32_postinstall.py -install
Cees Timmerman
  • 15,267
  • 10
  • 85
  • 116