ideasman42 / nerd-dictation

Simple, hackable offline speech to text - using the VOSK-API.
GNU General Public License v3.0
1.21k stars 104 forks source link

pipx installed vosk not recognized by nerd-dictation, nor installable using pipx!? #120

Open zenny opened 3 months ago

zenny commented 3 months ago

Hi,

There cannot be a better solution for STT in command line linux than nerd-dictation. Kudos to @ideasman42 for developing a nifty tool.

  1. Meanwhile there seems to be a dilemma that >python3.11 has moved from pip3 to pipx which nerd-dictation failed to detect:
$ ./nerd-dictation begin --vosk-model-dir=./model &
[1] 31046
[ zenny@MACHINE-GA-970A-D3 ~/Downloads/STT/nerd-dictation ]$ Traceback (most recent call last):
  File "/home/zenny/Downloads/STT/nerd-dictation/./nerd-dictation", line 1974, in <module>
    main()
  File "/home/zenny/Downloads/STT/nerd-dictation/./nerd-dictation", line 1970, in main
    args.func(args)
  File "/home/zenny/Downloads/STT/nerd-dictation/./nerd-dictation", line 1835, in <lambda>
    func=lambda args: main_begin(
                      ^^^^^^^^^^^
  File "/home/zenny/Downloads/STT/nerd-dictation/./nerd-dictation", line 1437, in main_begin
    found_any = text_from_vosk_pipe(
                ^^^^^^^^^^^^^^^^^^^^
  File "/home/zenny/Downloads/STT/nerd-dictation/./nerd-dictation", line 957, in text_from_vosk_pipe
    import vosk  # type: ignore
    ^^^^^^^^^^^
ModuleNotFoundError: No module named 'vosk'

[1]  + exit 1     ./nerd-dictation begin --vosk-model-dir=./model

Whereas pipx list shows the existence of vosk module:

   package vosk 0.3.45, installed using Python 3.12.2                                 │
    - vosk-transcriber
  1. I have also tried with the solution provided in https://github.com/ideasman42/nerd-dictation/pull/103 without success:
$ pipx install https://github.com/ideasman42/nerd-dictation.git
  ERROR: Cannot unpack file /tmp/pip-unpack-389h1kou/nerd-dictation.git (downloaded from /tmp/pip-req-build-8wu4622r, content-type: text/html; charset=utf-8); cannot detect
archive format
ERROR: Cannot determine archive format of /tmp/pip-req-build-8wu4622r
Cannot determine package name from spec
'https://github.com/ideasman42/nerd-dictation.git'. Check package spec for errors.

Any input appreciated.

Cheers, /z

sunberrysolar commented 2 months ago

Same here on manjaro, any help?

sunberrysolar commented 2 months ago

Solved on manjaro by installing python-vosk-api from AUR instead of using pip3, then follow the install instructions

DovieW commented 2 months ago

for me what fixed it was yay -S python-vosk-bin instead of using pip3 install vosk

I had to uninstall a package due to conflict with a package I guess I picked up from trying other commands: sudo pacman -R vosk-api-bin-debug

DovieW commented 1 month ago

For some reason, when i tried this on a different machine, i also had to add to the PYTHONPATH the location of the installed python-vosk-bin

get path with: sudo updatedb && locate vosk