1. Start a command line with admin rights.

  2. python -m pip install pywin32

  3. C:\Program Files\Stackless36\Scripts>python pywin32_postinstall.py -install The path C:\Program Files\Stackless36\ should be replaced with the path at which your Python version is installed.

  4. Test (admin rights optional) using python -c "import win32com" or python speak.py

    where speak.py consists of this text:

    import win32com.client
    
    speaker = win32com.client.Dispatch("SAPI.SpVoice")
    speaker.Speak("It works. Hoorah!")
    

Working fine on Python 3.6.4 Stackless 3.1b3 060516 (v3.6.4-slp:9557b2e530, Dec 21 2017, 15:23:10) [MSC v.1900 64 bit (AMD64)] on win32. Vanilla CPython hangs out here:

C:\Users\C\AppData\Local\Programs\Python\Python36-32>python.exe
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import win32com.client
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'win32com'
>>> exit()

C:\Users\C\AppData\Local\Programs\Python\Python36-32>python.exe -m pip install pywin32
Collecting pywin32
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/d4/2d/b927e61c4a2b0aaaab72c8cb97cf748c319c399d804293164b0c43380d5f/pywin32-223-cp36-cp36m-win32.whl (8.3MB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 8.3MB 50kB/s
Installing collected packages: pywin32
Successfully installed pywin32-223
You are using pip version 9.0.3, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Answer from Cees Timmerman on Stack Exchange
🌐
PyPI
pypi.org β€Ί project β€Ί pywin32
pywin32 Β· PyPI
We'd suggest installing from https://packages.msys2.org/base/mingw-w64-python-pywin32 pacman -S mingw-w64-python-pywin32.
      Β» pip install pywin32
    
Published Β  Jun 04, 2026
Version Β  312
Top answer
1 of 4
36
  1. Start a command line with admin rights.

  2. python -m pip install pywin32

  3. C:\Program Files\Stackless36\Scripts>python pywin32_postinstall.py -install The path C:\Program Files\Stackless36\ should be replaced with the path at which your Python version is installed.

  4. Test (admin rights optional) using python -c "import win32com" or python speak.py

    where speak.py consists of this text:

    import win32com.client
    
    speaker = win32com.client.Dispatch("SAPI.SpVoice")
    speaker.Speak("It works. Hoorah!")
    

Working fine on Python 3.6.4 Stackless 3.1b3 060516 (v3.6.4-slp:9557b2e530, Dec 21 2017, 15:23:10) [MSC v.1900 64 bit (AMD64)] on win32. Vanilla CPython hangs out here:

C:\Users\C\AppData\Local\Programs\Python\Python36-32>python.exe
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import win32com.client
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'win32com'
>>> exit()

C:\Users\C\AppData\Local\Programs\Python\Python36-32>python.exe -m pip install pywin32
Collecting pywin32
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/d4/2d/b927e61c4a2b0aaaab72c8cb97cf748c319c399d804293164b0c43380d5f/pywin32-223-cp36-cp36m-win32.whl (8.3MB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 8.3MB 50kB/s
Installing collected packages: pywin32
Successfully installed pywin32-223
You are using pip version 9.0.3, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
2 of 4
4

Check sys.path to make sure the directory where the module is installed is in there, otherwise you have to add it (google PYTHONPATH windows for some help with that.)

🌐
CodeSpeedy
codespeedy.com β€Ί home β€Ί how to install win32com.client in python
How to install win32com.client in Python | CodeSpeedy
December 25, 2022 - Learn how to install win32com.client in Python. Using this library you can access the windows 32 APIs from python.
🌐
Reddit
reddit.com β€Ί r/learnpython β€Ί how to install pywin32com.client (win32com) on pypy?
r/learnpython on Reddit: how to install pywin32com.client (win32com) on PyPy?
June 19, 2022 -

I seem to be able to install it using a normal python installation, but whenever I try any variaton of pypy -m pip install pypiwin32 it fails because one line of code somewhere is written with python 2 print syntax instead of python 3 print syntax.

File "C:\Users\UserName\AppData\Local\Temp\pip-install-s_f16dh8\pypiwin32_cbf43cf3d1b9474da7c0471119c544fe\setup.py", line 121

print "Building pywin32", pywin32_version

^

SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Building pywin32", pywin32_version)?

(Versions are Python 3.8.12 (9ef55f6fc369, Oct 24 2021, 20:12:27)

[PyPy 7.3.7 with MSC v.1929 64 bit (AMD64)] on win32)

🌐
Reddit
reddit.com β€Ί r/learnpython β€Ί no module named ’win32com’ error
r/learnpython on Reddit: No module named ’win32com’ error
August 10, 2022 -

Complete beginner in Python so excuse me for any terminology errors and such.

I installed pywin32 using pip install pywin32 as well as pypiwin32 in the same way, both appear in the pip list on the command prompt. However, when I try to import win32com.client (”import win32com.client as client”) in PyCharm, it gives me the following error: ”ModuleNotFoundError: No module named ’win32com’”.

Tried to Google for this error, but it seems everyone is saying that I don’t have pywin32 or pypiwin32 installed, which according to the pip list I do.

Does anyone have an idea of how I could fix this error? I’m on Windows 10 if that matters. Thanks in advance!

Top answer
1 of 1
7

Win32COM is part of [GitHub]: mhammond/pywin32 - pywin32.
According to the (above) URL, the package is only designed to work on Win:

Python for Win32 (pywin32) extensions

So, this is Win specific (it was never intended for other OSes).

As for your question, technically you could install it on Linux, or OSX (it is possible with some manual steps), but that would make absolutely no difference, because (even if installed) it would NOT run on those platforms, as it contains (consists of) binaries (.dlls) that don't run (can't be loaded by processes) on non Win OSes.

Just looked at the comments: [MS.Docs]: Office.MessageCompose interface is available on OSX, but (most likely, if there isn't already a Python wrapper available) you'd have to write the bindings yourself (their examples are in JS).



Additional (generic) information

Some packages are only meant to work in specific conditions, based on restricting criteria like:

  • Platform(s) (OS, CPU architecture)

  • Python version(s)

  • ...

even if not enforced by the installation mechanism (meaning they can somehow end up "installed" on platforms that they don't work on).
Anyway, such restrictions are (should be) mentioned (example for PyWin32 - see the red boxes) in package's:

  • PyPI page

  • Homepage

  • Other resources (e.g.: package's doc page, if it has one)

Bottom line is that such a package will not work outside the conditions it was meant to run in (even if it can be installed), and more: when attempting to run it, will yield some error message that might not be very clear.

There are packages with such restrictions, but can be installed outside them:

  • Win:

    • ComTypes

      • Error:

        [cfati@cfati-5510-0:/mnt/e/Work/Dev/StackOverflow/q064975918]> python -c "import comtypes"
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/home/cfati/.local/lib/python3.8/site-packages/comtypes/__init__.py", line 28, in <module>
            from _ctypes import COMError
        ImportError: cannot import name 'COMError' from '_ctypes' (/usr/lib/python3.8/lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so)
        
      • Fix (improvement): [GitHub]: enthought/comtypes - Improve error message on non Win

    • WConio2

      • Error:

        [cfati@cfati-5510-0:/mnt/e/Work/Dev/StackOverflow/q064975918]> python -c "import WConio2"
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/home/cfati/.local/lib/python3.8/site-packages/WConio2.py", line 125, in <module>
            from ctypes import windll
        ImportError: cannot import name 'windll' from 'ctypes' (/usr/lib/python3.8/ctypes/__init__.py)
        
      • Fix (improvement): [GitHub]: Solomoriah/WConio2 - Improve error message on non Win

Related (more or less):

  • [SO]: ImportError: No module named win32com.client (@CristiFati's answer)
🌐
YouTube
youtube.com β€Ί watch
How to install win32com Python library | Python Tutorial - YouTube
Buy Me a Coffee? https://www.paypal.me/jiejenn/5Your donation will support me to continue to make more tutorial videos!I am planning to create tutorials on h...
Published Β  June 30, 2019
Find elsewhere
🌐
Esri Community
community.esri.com β€Ί t5 β€Ί python-questions β€Ί win32-com-client β€Ί td-p β€Ί 73379
Solved: Win32.com client - Esri Community
May 31, 2017 - Can some one be kind engought to guide me though install win32com.client pkg please. Solved! Go to Solution. ... Thanks!... corrected now ... Dan, is there any reason to do this using pip instead of the windows installer at sourceforge, which adds an entry to add remove programs and all that Windows jazz? I've always pointed people to the sourceforge download. ... I clean out stuff manually before and after or through windows doing installs. Also, I still use pythonwin for an IDE on occasions and installing it took care of all the dependencies and cleanup.
🌐
Quora
quora.com β€Ί How-do-I-import-win32com-client-in-Python
How to import win32com.client in Python - Quora
Answer: To import any package in python first you have to install that package in your machine . To install the package in python there is utility pip. pip is a package management system used to install and manage software packages written in Python. To install win32com.client in python using p...
🌐
Python Programming
pythonprogramming.altervista.org β€Ί how-to-install-the-win32com-module-to-make-the-computer-speak
How to install the win32com module (to make the computer speak) – python programming
July 15, 2018 - http://pythonprogramming.altervista.org/wp-content/uploads/2018/07/install_win32.mp4 Β· # computer windows speaks from win32com.client import Dispatch speak = Dispatch("SAPI.SpVoice") speak.Speak("Ciao") Pinterest Β· X Β· Facebook Β· WhatsApp Β· Advertisement Β·
🌐
Python.org
discuss.python.org β€Ί python help
Win32com.client - Python Help - Discussions on Python.org
June 18, 2022 - Hi everyone I am trying to create a log using win32com.client module - I have installed the module with the following command - pip install pywin32 - Installation was successful. However when I tried to run the below script I get the following error.
🌐
Medium
medium.com β€Ί @balaug3 β€Ί pywin32-14dc01913acb
PyWin32. You’re referring to win32com, a module… | by Balaug | Medium
January 22, 2024 - COM Automation: win32com allows Python scripts to automate applications that support the Component Object Model (COM), like Microsoft Office applications. Reading and Writing Files: It’s commonly used for reading from and writing to Excel files, manipulating Word documents, etc. Installation: You can install PyWin32, which includes win32com, using pip:
🌐
Safe Community
community.safe.com β€Ί home β€Ί forums β€Ί fme form β€Ί general β€Ί can you use win32com with the python interpreter in fme desktop?
Can you use win32com with the Python interpreter in FME Desktop? | Community
February 12, 2022 - FME 2021.2.2 on Windows 11 To use the win32com module with a PythonCaller, I have installed the module with this command.fme.exe python -m pip install pywin32 --target C:\\Users\\<user>\\Documents\\FME\\Plugins\\Python cf.
🌐
Stack Exchange
gis.stackexchange.com β€Ί questions β€Ί 265905 β€Ί installed-pywin-32-still-getting-error-no-module-named-win32com-client
python - Installed pywin 32 -- still getting error -- "No module named win32com.client." - Geographic Information Systems Stack Exchange
I would try and use pip install pypiwin32 if you could. stackoverflow.com/a/34993224/2258 Not sure if it will fix your issue, however. ... Works fine on Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32.
🌐
Esri Community
community.esri.com β€Ί t5 β€Ί python-questions β€Ί how-to-install-pywin32-for-arcgis-pro-3-x β€Ί td-p β€Ί 1223077
Solved: how to install pywin32 for ArcGIS Pro 3.x - Esri Community
August 29, 2024 - Is a useful step to anticipate installation issues beforehand. ... I was working in a clone. I switched back to base (arcgispro-py3) and get this in a Python command prompt. (arcgispro-py3) C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3>python Python 3.9.11 [MSC v.1931 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from win32com ...
🌐
Plain English
python.plainenglish.io β€Ί python-and-the-win32com-interface-for-automation-a02610c6b8fc
Python and the Win32COM Interface for Automation | by Py-Core Python Programming | Python in Plain English
January 6, 2025 - This guide walks through a real-world example of using Python to create and manage a scheduled task that zips video files older than 30 days. The Win32COM module (part of pywin32) allows Python to interact with Windows-specific COM objects.
🌐
WMI
timgolden.me.uk β€Ί pywin32-docs β€Ί html β€Ί com β€Ί win32com β€Ί HTML β€Ί QuickStartClientCom.html
Quick Start to Client side COM and Python - Tim Golden
Note that this package requires Pythonwin (ie, the MFC GUI environment) to be installed for this to work. There are far better COM browsers available - I tend to use the one that comes with MSVC, or this one! To run the browser, simply select it from the Pythonwin Tools menu, or double-click on the file win32com\client\combrowse.py