Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No module named Win32com.client error when using the pyttsx package

Today, while surfing on Quora, I came across answers on amazing things that python can do. I tried to use the pyttsx Text to Speech Convertor and that gave me an No module named Win32com.client error.

There are many answers on this error but most of them weren't sufficient enough (Atleast for me) as the proposed solutions didn't matched the requirements.

For starters, I'm using Python2.7, and there are no DLLs in the C:/Windows/System32 or any Scripts related to the keyword 'pywin32' in my C:/Python27/Scripts Folder. I need a concrete solution.

This is what I have tried so far:

>>> import pyttsx
>>> engine = pyttsx.init()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\pyttsx\__init__.py", line 39, in init
eng = Engine(driverName, debug)
File "C:\Python27\lib\site-packages\pyttsx\engine.py", line 45, in __init__
self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
File "C:\Python27\lib\site-packages\pyttsx\driver.py", line 64, in __init__
self._module = __import__(name, globals(), locals(), [driverName])
File "C:\Python27\lib\site-packages\pyttsx\drivers\sapi5.py", line 19, in <module>
import win32com.client
ImportError: No module named win32com.client

SOLUTION: Install the package from This Link. Choose the 32/64 bit version depending on your Python installation type (32/64 bit).

like image 825
burglarhobbit Avatar asked Feb 13 '16 13:02

burglarhobbit


People also ask

What is win32com in Python?

win32com.server packageSupport for COM servers written in Python. The modules in this package provide most of the underlying framework for magically turning Python classes into COM servers, exposing the correct public methods, registering your server in the registry, etc.

Does win32com work on Linux?

Certainly not. win32com looks like a Windows specific library, tied to the WinAPI. Linux has a different operating system API (because Linux is not Windows and both are different OSes), mostly following the POSIX standards.


1 Answers

I had the same problem. I installed pywin32 from here (download the build as per your preference). I downloaded for my python version (32 bit).

After installing I was able to import win32com.client

import win32com.client
like image 181
Jeril Avatar answered Nov 14 '22 22:11

Jeril