PYTTSX Error: Cannot find module named drivers

两盒软妹~` 提交于 2019-12-24 07:17:23

问题


I am still a novice when it comes to python, and recently I have attempted to construct a personal assistant. I am using the PyTTSX module, but when I attempt to initialize the package, I receive this error:

****File "C:\Python34\lib\site-packages\pyttsx\driver.py", line 64, in init self._module = import(name, globals(), locals(), [driverName]) ImportError: No module named 'drivers**'**

Any feedback would be greatly appreciated.


回答1:


You've probably downloaded the version of PyTTSX from the website, which was built for Python 2. The updated version can be found on GitHub here. Copy the contents of pyttsx/pyttsx into your pythonXX/Lib/site-packages/pyttsx folder and you should be good to go.




回答2:


There is now a python3 compatible version of pyttsx and is called pyttsx3

just use pip install pyttsx3

Its usage is almost same as that of pyttsx

import pyttsx3
engine  = pyttsx3.init()
engine.say("hello")
engine.runAndWait()


来源:https://stackoverflow.com/questions/43012023/pyttsx-error-cannot-find-module-named-drivers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!