Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't initialize Pocketsphinx, '_NamespacePath' object is not subscriptable. #391

Open
daniel-maxwell opened this issue Jul 4, 2024 · 1 comment

Comments

@daniel-maxwell
Copy link

daniel-maxwell commented Jul 4, 2024

Hi, would someone mind taking a look at my setup? Tried multiple different approaches including trying to pass a hard coded string path, but I always get '_NamespacePath' object is not subscriptable. error.

Processor: AMD Ryzen 9 5900X 12-Core Processor 4.20 GHz
Installed RAM: 32.0 GB
System type: 64-bit operating system, x64-based processor
Edition: Windows 10 Pro
Python version: 3.7.16
Pocketsphinx version: 5.0.3
Location: c:\programdata\anaconda\envs\speech_recognition_venv\lib\site-packages

from pocketsphinx import Pocketsphinx
  
    def initialize_models(self):
        # Initialize PocketSphinx
        try:
            ps = Pocketsphinx()
            self.ps_decoder = ps.decode
            self.asr_systems['pocketsphinx'] = self.pocketsphinx_recognize
        except ImportError:
            print("PocketSphinx is not installed.")
        except Exception as e:
            print(f"There was an error initializing PocketSphinx: {str(e)}.")

Output:
There was an error initializing PocketSphinx: '_NamespacePath' object is not subscriptable.

@dhdaines
Copy link
Contributor

dhdaines commented Jul 6, 2024

Hrm! I'm not familiar with that code as it was added by previous maintainers. Looks like a bug in PocketSphinx, will check it out now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants