The code
import win32com.client as win32
Excel = win32.gencache.EnsureDispatch('Excel.Application')
used to work, but now it produces the error:
AttributeError: 'module' object has no attribute 'CLSIDToPackageMap'
what's going on?
There are several APIs available to convert text to speech in python. One of such APIs available in the python library commonly known as win32com library. It provides a bunch of methods to get excited about and one of them is the Dispatch method of the library.
The win32com. client package contains a number of modules to provide access to automation objects. This package supports both late and early bindings, as we will discuss.
After deleting C:\Temp\gen_py, the code above works again. Hope it can save trouble!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With