2014-05-21 68 views
0

我是新来的Python和我安装了speech库。但每当我从Python中导入speech壳它给错误语音库安装错误

>>> import speech 
Traceback (most recent call last): 
    File "<pyshell#0>", line 1, in <module> 
    import speech 
    File "C:\Python34\lib\site-packages\speech-0.5.2-py3.4.egg\speech.py", line 55, in <module> 
    from win32com.client import constants as _constants 
    File "C:\Python34\lib\site-packages\win32com\__init__.py", line 5, in <module> 
    import win32api, sys, os 
ImportError: DLL load failed: The specified module could not be found. 
+0

您是否尝试过卸载并重新安装? – Mansueli

+1

似乎'语音'模块对'win32api'有一个未声明的依赖关系。所以下载和安装[pywin32](http://sourceforge.net/projects/pywin32/)可能会有所帮助。 –

回答

0

你需要安装pywin32

使用easy_install pywin32pip install pywin32

0

speech库需要你安装pywin32,如在解说的requirements section指出:

需要Windows XP或Vista,和Python 2.4或2.5。如果您使用Windows Vista的 ,则需要说“开始收听”,如果语音 识别不醒。

除了easy_installing speech.py​​,你需要pywin32(用于 的Python 2.5或Python的2.4);如果您使用的是XP,则需要安装微软语音套件(此处为安装程序) 。

因此,在尝试导入speech之前下载并安装pywin32