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.)

Discussions

how to install pywin32com.client (win32com) on PyPy?
Hello, I'm a Reddit bot who's here to help people nicely format their coding questions. This makes it as easy as possible for people to read your post and help you. I think I have detected some formatting issues with your submission: Inline formatting (`my code`) used across multiple lines of code. This can mess with indentation. If I am correct, please edit the text in your post and try to follow these instructions to fix up your post's formatting. Am I misbehaving? Have a comment or suggestion? Reply to this comment or raise an issue here . More on reddit.com
🌐 r/learnpython
4
1
June 19, 2022
python - Install win32com on MacOs and Linux - Stack Overflow
My question is simple: can I install win32com python API (pywin32 notably) on an OS that is not Windows? I have been trying, on Mac, multiple versions of pip install pywin32, all have failed. An ex... More on stackoverflow.com
🌐 stackoverflow.com
No module named ’win32com’ error
Usually this type of error means that pycharm is using a virtual environment. The easy way to solve this is to use the pip command in the pycharm terminal, instead of in the command line. Pycharm also has a handy GUI for managing packages. https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html#packages-tool-window More on reddit.com
🌐 r/learnpython
2
1
August 10, 2022
Win32com.client
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. The Python Win32 extensions for NT (service, ... More on discuss.python.org
🌐 discuss.python.org
11
0
June 18, 2022
🌐
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)

🌐
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 ·
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)
Find elsewhere
🌐
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
🌐
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!

🌐
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.
🌐
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.
🌐
YouTube
youtube.com › watch
How to Install PYWin32 in Python on Windows 10/11 (2023)
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
🌐
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...
🌐
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:
🌐
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.
🌐
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.
🌐
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 ...