Python 3.4 :ImportError: no module named win32api

Maxxie picture Maxxie · Aug 12, 2014 · Viewed 88.3k times · Source

I am using python 3.4 on windows 7.In order to open a doc file i am using this code

import sys
import win32com.client as win32

word = win32.Dispatch("Word.Application")
word.Visible = 0
word.Documents.Open("MyDocument")
doc = word.ActiveDocument

M not sure why is this error popping up everytime

ImportError: no module named win32api

Although i have installed pywin32 from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pywin32 and i have also checked the path from where i am importing...i have tried reinstalling pywin32 as well but that doesnt remove the error.....

any suggestions....please help

Thanks

Answer

Nima Soroush picture Nima Soroush · Oct 21, 2014

Try to install pywin32 from here :

http://sourceforge.net/projects/pywin32/files/pywin32/

depends on you operation system and the python version that you are using. Normally 32bit version should works on both 32 and 64 bit OS.

EDIT: moved to https://github.com/mhammond/pywin32/releases