How to install python package vosk system wide?

Hi everyone,

I am trying to install python-vosk system wide in Manjaro XFCE, as I want to launch a software that needs vosk. I know that it is recommended to use pacman -S python-vosk (or vosk-bin, etc) but I couldn’t find the package, so I am forced to install it with venv. The problem, is that now I need to activate the venv to launch the software every time. Am I missing something?

Is this really the way to do so? Why did it become so complicated in Manjaro to install python packages? It was so much easier to do so before with just pip…

Not really

Due to the heavy interference with the system python and the package manager the venv method is the recommended. This is PEP668 recommendation

There is the python-pipx which may be what you are looking for

sudo pacman -Syu python-pipx

Then you can do

 $ pipx install vosk
  installed package vosk 0.3.45, installed using Python 3.11.8
  These apps are now globally available
    - vosk-transcriber
done! ✨ 🌟 ✨

Thanks, I did the pipx install… and says it is installed successfully, but somehow I get the same error: AttributeError: module ‘vosk’ has no attribute ‘SetLogLevel’. Not sure why…

I created a script to run “source venv vosk & launch command & deactivate” as a workaround, but not optimal.

It’s available in the AUR, so you do have a choice.

Yeah, thanks for pointing it out, my phrasing was poor… but your comment doesn’t bring much to the discussion. Can it be installed system-wide from the AUR? If so, would it be better than using pipx, or would it lead to the same result?

Don’t get blinded by the package manager and AUR - you don’t have to.

Repeating myself - advise from above

sudo pacman -Syu pipx
pipx install vosk

Using pipx - you install from pypi and it works for vosk too - it is installed systemwide in the sense it can be run from any commandline - but it is not installed for other users on a multihomed system

  • pipx — Closely related to pip, but creates, for the user running it, an isolated environment for each application and its associated packages, preventing conflicts with system packages. Focused on packages that can be run from the command line directly as applications. You can use pipx to install packages from the Python Package Index and other indexes.

pipx || python-pipx

Python Package management - Arch Wiki

Also see → [Python Troubleshoting - ArchWiki]



It’s basically the same as installing it from the repos, but requires more knowledge to be safe. It sounds like you don’t know much about using the AUR, so perhaps best to stick with pipx.

Ok, so it seems there must be some error on the main py script I am using, which depends on vosk; somehow there is a problem when vosk is installed with pipx, but not in venv… not sure why. I will check into that.

Thanks for your time, appreciate it!

pipx stores the installed packages and their dependencies i ~/.local/share/pipx

Technically it is doing the same you do in a venv but it abstracts the cli interaction

pipx run vosk

Documentation for pipx on Linux

So if you need to create an instance of vosk - usable like regular python-packages installed from the repo - you will need to install it to site-packages, which - at any point in time - may create package manager conflicts if files installed by vosk is also installed by another repo package.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.