0

I am using the python 2.7.13 shell, as you can see in the code below, I have installed speechrecognition, but it isn't showing up.

>>> pip.main (['install','speechrecognition'])
Requirement already satisfied: speechrecognition in 
c:\python27\lib\site-packages
0
>>> import speechrecognition

Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
import speechrecognition
ImportError: No module named speechrecognition
>>>

1 Answers1

2

Try

import speech_recognition

Note the underscore

Maximilian Peters
  • 30,348
  • 12
  • 86
  • 99
  • Thank you, I have no idea why it was able to install without the underscore but needs it to import, but thank you – Devon Carriere Sep 15 '17 at 18:09
  • The package name in `pip` and when importing it do not necessarily match: https://stackoverflow.com/questions/11453866/given-the-name-of-a-python-package-what-is-the-name-of-the-module-to-import – Maximilian Peters Sep 15 '17 at 23:09