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

Install failure on Linux Mint 22 #130

Open
MintMusic opened this issue Aug 3, 2024 · 3 comments
Open

Install failure on Linux Mint 22 #130

MintMusic opened this issue Aug 3, 2024 · 3 comments

Comments

@MintMusic
Copy link

I successfully installed and used nerd-dictation on Mint 20.

I upgraded my system to Mint 22 using Aptik. nerd-dictation no longer worked. "pip3 install vosk" is not longer valid. I used "pipx install vosk" instead. When I ran nerd-dictation, I got the following:

Traceback (most recent call last):
File "/home/edwin/nerd-dictation/./nerd-dictation", line 1974, in
main()
File "/home/edwin/nerd-dictation/./nerd-dictation", line 1970, in main
args.func(args)
File "/home/edwin/nerd-dictation/./nerd-dictation", line 1835, in
func=lambda args: main_begin(
^^^^^^^^^^^
File "/home/edwin/nerd-dictation/./nerd-dictation", line 1437, in main_begin
found_any = text_from_vosk_pipe(
^^^^^^^^^^^^^^^^^^^^
File "/home/edwin/nerd-dictation/./nerd-dictation", line 957, in text_from_vosk_pipe
import vosk # type: ignore
^^^^^^^^^^^
ModuleNotFoundError: No module named 'vosk'

I'm stuck!

@beng-tang
Copy link

There is a video on how to fix the Linux Mint 22 install problem here:
https://www.youtube.com/watch?v=CGjXXy8yHHA

@MintMusic
Copy link
Author

Thanks, beng-tang! Worked like a charm!

I will summarize what I learned from the video and used successfully:

Before starting the "Install" steps in the instructions, execute the following.
sudo apt install python3-pip
sudo rm /usr/lib/python3.*/EXTERNALLY-MANAGED

After that, everything works as described in the instructions.

This is ONLY for Linux Mint 22, AFAIK. Earlier Mint versions should work per the given instructions. It wouldn't hurt to watch the nice video to see the steps for yourself.

@fantele
Copy link

fantele commented Sep 25, 2024

Since the problem only occurs with vosk installed via pipx but not if installed with pip3, you can just use a virtual environment.
Create a new virtual environment, activate it and install vosk via pip3:
python3 -m venv PATH-TO-NERD-DICTATION-VENV
source PATH-TO-NERD-DICTATION-VENV/bin/activate
pip3 install vosk
deactivate

If you change the shebang in the first line of the nerd-dictation source code from #!/usr/bin/env python3 to #!PATH-TO-NERD-DICTATION-VENV/bin/python3, the program will always be executed in the virtual environment and should work as usual.

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

No branches or pull requests

3 participants