Unable to use python speech_recognition package

asked 2020-08-19 01:02:19 -0600

RohitM gravatar image

I am trying to use the python speech_recognition package with ros.

If I open up a python instance without sourcing ros then I am able to import the package.

Python 2.7.17 (default, Jul 20 2020, 15:37:01) 
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import speech_recognition as sr
>>> b = sr.Recognizer()

But if I perform the same steps after sourcing ros in my workspace then I am unable to import the package

Python 2.7.17 (default, Jul 20 2020, 15:37:01) 
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import speech_recognition as sr
>>> b = sr.Recognizer()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'Recognizer'

Perhaps there is some naming conflict within the ros workspace. Can someone suggest how I can resolve this?

edit retag flag offensive close merge delete