我正在尝试使用Python 3运行语音程序,如下所示:https://stackoverflow.com/a/31257805/760393
但我不断收到错误: .. \ site-packages \ pyttsx \ engine.py,第18行,导入驱动程序..
请帮忙。
Traceback (most recent call last):
File "C:/Users/USER/AppData/Local/Programs/Python/Python35-32/0DEV/L X/voice2.py", line 1, in <module>
import pyttsx
File "C:\Users\USER\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pyttsx\__init__.py", line 18, in <module>
from .engine import Engine
File "C:\Users\USER\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pyttsx\engine.py", line 18, in <module>
import driver
ImportError: No module named 'driver'
答案 0 :(得分:1)
我有这个问题。在driver.py
中调用engine.py
文件时出错。
您必须编辑引擎文件,并在调用部分更改此:
import driver
为:
from . import driver