无法使用python 2.6导入speech_recognition

时间:2017-05-26 19:03:53

标签: python speech-recognition

我无法在Centos 6.5上使用python 2.6导入speech_recognition模块。我已经使用pip安装了SpeechRecognition,并且安装成功没有任何错误。

pip install SpeechRecognition

Downloading SpeechRecognition-3.6.5-py2.py3-none-any.whl (31.8MB)
100% |████████████████████████████████| 31.8MB 14kB/s 
Installing collected packages: SpeechRecognition
Successfully installed SpeechRecognition-3.6.5

但不知怎的,我无法导入它。

>>> import speech_recognition
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/site-packages/speech_recognition/__init__.py", line 1070
if system == "Windows" and machine in {"i686", "i786", "x86", "x86_64", "AMD64"}:
                                             ^
SyntaxError: invalid syntax
>>> 

2 个答案:

答案 0 :(得分:0)

pip install SpeechRecognition
pip install pyaudio

答案 1 :(得分:0)

尝试sudo pip3 install-升级语音识别