ImportError:没有名为' driver'

时间:2016-07-21 12:56:45

标签: python-3.x

我正在尝试使用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'

1 个答案:

答案 0 :(得分:1)

我有这个问题。在driver.py中调用engine.py文件时出错。 您必须编辑引擎文件,并在调用部分更改此:

import driver

为:

from . import driver