speech_recognition: SpeechRecognition installed with pip and pip3 but can't import it in either terminal or atom.io

Steps to reproduce

  1. (How do you make the issue happen? Does it happen every time you try it?) Every time I try to import speech_recogntion in a python file, it can’t be imported and I get an error.

  2. (Make sure to go into as much detail as needed to reproduce the issue. Posting your code here can help us resolve the problem much faster!) I wrote a one-line file with simple command import speech-recognition and it gives me the following error: import speech_recognition as sr ImportError: No module named speech_recognition I have this module installed using both pip and pip3 and it appears in their list of installed modules but I can’t seem to get it to be imported when i try executing a script either from the terminal or in atom.io. I am not sure why this is, I would really appreciate any help in this regard

  3. (If there are any files, like audio recordings, don’t forget to include them.)

Expected behaviour

(What did you expect to happen?)

Actual behaviour for the module to be imported properly without any error

(What happened instead? How is it different from what you expected?)

(If the library threw an exception, paste the full stack trace here)

System information

(Delete all the statements that don’t apply.)

My system is <Ubuntu 16.04 LTS >

My Python version is <Python 2.7.12>.

My Pip version is <pip 9.0.1>.

My SpeechRecognition library version is <SpeechRecognition (3.6.5)

.

My PyAudio library version is 0.2.8

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (3 by maintainers)

Most upvoted comments

You must have multiple versions like anaconda also installed which overrides the running instances but the module is installed in the pip versions. Also if you are using pycharm : you can configure your idle through File --> settings --> Project intrepreter --> choose the intrepreter for the project. The problem is that there are multiple pip’s of 2 and 3 Like Anaconda pip itself, and then python pip2 and python pip3 while the pip is the main thing that It might be possibility that anaconda is being overriden on all pips so for that use “CONDA INSTALL Speech_recognition” and then try

Hi @sanster9292,

Can you post the following outputs?

  • which pip and which python.
  • The full output of pip install --upgrade speechrecognition.
  • python -c 'import sys; print(sys.path)'.

We can probably figure out what the problem is from these outputs.

You must have multiple versions like anaconda also installed which overrides the running instances but the module is installed in the pip versions. Also if you are using pycharm : you can configure your idle through File --> settings --> Project intrepreter --> choose the intrepreter for the project. The problem is that there are multiple pip’s of 2 and 3 Like Anaconda pip itself, and then python pip2 and python pip3 while the pip is the main thing that It might be possibility that anaconda is being overriden on all pips so for that use “CONDA INSTALL Speech_recognition” and then try

bro thanks I was stuck because of this problem but know I resolved it because of you