Skip to content

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

@daniel-maxwell

Description

@daniel-maxwell

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions