Python 3.4 :ImportError: no module named win32api

前端 未结 6 1429
萌比男神i
萌比男神i 2020-11-28 11:26

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.         


        
6条回答
  •  醉酒成梦
    2020-11-28 12:04

    This is a bug in the library itself, probably they used a different python implementation for creating this.

    What they are trying to import is the site-packages\win32\win32api.pyd file, but the win32 folder is not in the path that python searches in, but site-packages is.

    Try to replace the import win32api (inside win32com\__init__.py) to from win32 import win32api

提交回复
热议问题