Uberi / speech_recognition

Speech recognition module for Python, supporting several engines and APIs, online and offline.
https://pypi.python.org/pypi/SpeechRecognition/
BSD 3-Clause "New" or "Revised" License
8.36k stars 2.39k forks source link

Namespace collision on Debian #251

Open mertyildiran opened 7 years ago

mertyildiran commented 7 years ago

While I was trying to pack your project for Debian with purpose of uploading to their repositories I got these errors:

======================================================================
ERROR: test_sphinx_keywords (tests.test_special_features.TestSpecialFeatures)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/test_special_features.py", line 17, in test_sphinx_keywords
    self.assertEqual(r.recognize_sphinx(audio, keyword_entries=[("one", 1.0), ("two", 1.0), ("three", 1.0)]), "three  two  two  one ")
  File "speech_recognition/__init__.py", line 657, in recognize_sphinx
    raise RequestError("missing PocketSphinx module: ensure that PocketSphinx is set up correctly.")
RequestError: missing PocketSphinx module: ensure that PocketSphinx is set up correctly.

======================================================================
ERROR: test_google_chinese (tests.test_recognition.TestRecognition)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/test_recognition.py", line 34, in test_google_chinese
    self.assertEqual(r.recognize_google(audio, language="zh-CN"), u"砸自己的脚")
  File "speech_recognition/__init__.py", line 766, in recognize_google
    raise RequestError("recognition connection failed: {}".format(e.reason))
RequestError: recognition connection failed: [Errno 111] Connection refused

======================================================================
ERROR: test_google_english (tests.test_recognition.TestRecognition)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/test_recognition.py", line 24, in test_google_english
    self.assertEqual(r.recognize_google(audio), "one two three")
  File "speech_recognition/__init__.py", line 766, in recognize_google
    raise RequestError("recognition connection failed: {}".format(e.reason))
RequestError: recognition connection failed: [Errno 111] Connection refused

======================================================================
ERROR: test_google_french (tests.test_recognition.TestRecognition)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/test_recognition.py", line 29, in test_google_french
    self.assertEqual(r.recognize_google(audio, language="fr-FR"), u"et c'est la dictée numéro 1")
  File "speech_recognition/__init__.py", line 766, in recognize_google
    raise RequestError("recognition connection failed: {}".format(e.reason))
RequestError: recognition connection failed: [Errno 111] Connection refused

======================================================================
ERROR: test_sphinx_english (tests.test_recognition.TestRecognition)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/test_recognition.py", line 19, in test_sphinx_english
    self.assertEqual(r.recognize_sphinx(audio), "wanted to three")
  File "speech_recognition/__init__.py", line 657, in recognize_sphinx
    raise RequestError("missing PocketSphinx module: ensure that PocketSphinx is set up correctly.")
RequestError: missing PocketSphinx module: ensure that PocketSphinx is set up correctly.

----------------------------------------------------------------------

I think Google tests are related to missing key (but also need to be fixed).

The critical error in here is RequestError: missing PocketSphinx module: ensure that PocketSphinx is set up correctly. . So I looked up to situation and realized that there is a namespace collision between: https://pypi.python.org/pypi/pocketsphinx (source: https://github.com/bambocher/pocketsphinx-python) and https://packages.debian.org/jessie/python/python-pocketsphinx (source: https://github.com/cmusphinx/pocketsphinx/tree/master/swig/python)

Uberi/speech_recognition is using https://pypi.python.org/pypi/pocketsphinx but it's a different module from https://packages.debian.org/jessie/python/python-pocketsphinx. I don't know how we can resolve this issue but we need to fix that.

Please tell me your thoughts...

vivekaditya commented 7 years ago

selection_193 pip3 install pocketsphinx is also not working

Uberi commented 6 years ago

Hi @mertyildiran,

Thanks for the info! I'm not sure the pocketsphinx namespace collision can be easily resolved, since pocketsphinx 0.8.5 won't work with this library. The current version is 0.1.3, but it'll happily work with any version down to 0.0.9. Do you think that is a feasible upgrade?

As for the other test failures, I've upgraded these quite a bit since July (I am severely behind on my email!). However, some tests can still fail occasionally due to third-party service availability issues. If it helps, we could certainly put these network-dependent tests behind a flag.