No Module named 'pywintypes'
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
Here is the output when I try to run a script:
Traceback (most recent call last):
File "C:\Users\foo\Python\Python35\outlooktest.py", line 1, in <module>
from win32com.client import Dispatch, GetObject
File "C:\Users\foo\AppData\Local\Programs\Python\Python36-32\lib\site-packages\win32com__init__.py", line 7, in <module>
import pythoncom
File "C:\Users\foo\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pythoncom.py", line 2, in <module>
import pywintypes
ModuleNotFoundError: No module named 'pywintypes'
Package was instralled from pypi through pip.
Also had to modify the init script for win32com by changing the line import win32pi, sys, os to two lines:
from win32 import win32api
import sys, os
Sadly installing via pip has issues due to the fact it doesn't run the postinstall script. You could try manually running "python pywin32_postinstall.py -install"
First, I haven't seen this issue on win_amd64. Second, @Mark Hammond Python has implemented PEPs (cannot recall numbers off the top of my head) that explicitly discourage postinstall scripts, due to a number of issues that wheel was designed to solve.