aidygus / LinVAM

Linux Voice Activated Macro
GNU General Public License v3.0
60 stars 6 forks source link

No module named 'pocketsphinx' #11

Open Beethoven-n opened 1 year ago

Beethoven-n commented 1 year ago

I tried to install this into a venv so I could isolate the dependencies, but either inside the venv or outside of it, I get this error:

Traceback (most recent call last):
  File "/home/dogbold/git/LinVAM/./main.py", line 6, in <module>
    from profileeditwnd import ProfileEditWnd
  File "/home/dogbold/git/LinVAM/profileeditwnd.py", line 7, in <module>
    from profileexecutor import *
  File "/home/dogbold/git/LinVAM/profileexecutor.py", line 8, in <module>
    from pocketsphinx.pocketsphinx import *
ModuleNotFoundError: No module named 'pocketsphinx'

For added context, I'm on an Arch Linux setup with pocketsphinx 5.0.0-2 installed by pacman, and the venv has version 5.0.1 installed.

I can replicate the error straight after cloning the repo, with no venv installed there, so I doubt that the venv has anything to do with it actually

smirgol commented 1 year ago

I think you need to install pocketsphinx with pip, which is the python wrapper for pocketsphinx. pip install pocketsphinx

If that succeeds, you might run into another issue with No module named 'pocketsphinx.pocketsphinx' and then another one regarding the Decoder options: ERROR: "ps_config.c", line 158: Only one of lm, jsgf, fsg, keyphrase, kws, allphone, lmctl, can be enabled at a time in config. I've created a testbranch where I've fixed these, if you could test that and probably leave a reply if it works for you, that'd be great! https://github.com/smirgol/LinVAM/tree/testbranch

Beethoven-n commented 1 year ago

on my distro, pocketsphinx is an externally managed package, and can't be installed via pip install. do i need a venv?

Beethoven-n commented 1 year ago

alright, so the program seems to actually do something when i run it in a venv with python main.py -noroot instead of ./main.py -noroot. maybe i should alias this? idk

thanks for making it work!

Beethoven-n commented 1 year ago

went ahead and threw together an appimage for it to future proof it so i can keep using it. should i upload it? nevermind, turns out there's a bit of work to do so i can run appimage on any old machine. maybe i should get rid of the copy of pip inside there, etc

PaulTGG commented 1 year ago

I think you need to install pocketsphinx with pip, which is the python wrapper for pocketsphinx. pip install pocketsphinx

If that succeeds, you might run into another issue with No module named 'pocketsphinx.pocketsphinx' and then another one regarding the Decoder options: ERROR: "ps_config.c", line 158: Only one of lm, jsgf, fsg, keyphrase, kws, allphone, lmctl, can be enabled at a time in config. I've created a testbranch where I've fixed these, if you could test that and probably leave a reply if it works for you, that'd be great! https://github.com/smirgol/LinVAM/tree/testbranch

I was running into the "no pocketsphinx.pocketsphinx" error, and the test branch code fixed it!