Sunday, March 26, 2017

Python 3: ImportError: no module named win32api

I'm using Python 3.5 (32-bit) with pywin32 installed. I was trying to import win32com.client. but I was getting ImportError: no module named win32api

Solution:
As TulkinRB mentioned here, it seems like a bug with the module. I was able to fix it by editing Python35\Lib\site-packages\win32com\__init__.py, and replace import win32api with from win32 import win32api.

Ref:
pywin32 - Python 3.4 :ImportError: no module named win32api - Stack Overflow

No comments: