ImportError: No module named win32com.client

user3194189 picture user3194189 · May 26, 2014 · Viewed 272.3k times · Source

I am currently using python 2.7 and trying to open an Excel sheet. When using the code below:

import os
from win32com.client import Dispatch

xlApp = win32com.client.Dispatch("Excel.Application")
xlApp.Visible = True
# Open the file we want in Excel
workbook = xlApp.Workbooks.Open('example.xls')

I get this error:

ImportError: No module named win32com.client

Is there any possibility of getting the error since I am using 64-bit Windows machine?

Answer

Mitch44 picture Mitch44 · Oct 4, 2016

pip install pywin32 didn't work for me but pypiwin32 did.