ultrabug / py3status

py3status is an extensible i3status wrapper written in python
https://ultrabug.github.io/py3status/
BSD 3-Clause "New" or "Revised" License
883 stars 259 forks source link

dbus installation problem #2213

Closed vzaliva closed 8 months ago

vzaliva commented 10 months ago

Describe the bug

"vpn_status" module does not work as expected. It just shows "vpn_status" text.

Your py3status version

py3status version 3.52 (python 3.11.4) on i3

To Reproduce

Add module "vpn_status" Run py3status -d -l log.txt

Expected behavior

to show VPN status. Instead in the log file I see the following error:

2023-08-07 10:30:11 INFO loading module "vpn_status" from py3status.modules.vpn_status
2023-08-07 10:30:11 INFO Module `vpn_status` could not be loaded (No module named 'dbus')
2023-08-07 10:30:11 INFO No module named 'dbus'

Additional context py3status installed via :

$ pipx install py3status --include-deps --force --verbose
pipx >(setup:757): pipx version is 1.1.0
pipx >(setup:758): Default python interpreter is '/usr/bin/python3'
pipx >(package_name_from_spec:323): Determined package name: py3status
pipx >(package_name_from_spec:324): Package name determined in 0.0s
pipx >(needs_upgrade:69): Time since last upgrade of shared libs, in seconds: 611733. Upgrade will be run by pipx if greater than 2592000.
Installing to existing venv 'py3status'
creating virtual environment...
pipx >(run_subprocess:173): running /usr/bin/python3 -m venv --without-pip /home/lord/.local/pipx/venvs/py3status
pipx >(run_subprocess:173): running /home/lord/.local/pipx/venvs/py3status/bin/python -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:173): running /home/lord/.local/pipx/shared/bin/python -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:173): running /home/lord/.local/pipx/venvs/py3status/bin/python --version
pipx >(_parsed_package_to_package_or_url:128): cleaned package spec: py3status
installing py3status...
pipx >(run_subprocess:173): running /home/lord/.local/pipx/venvs/py3status/bin/python -m pip install py3status
pipx >(run_subprocess:173): running <fetch_info_in_venv commands>
pipx >(get_venv_metadata_for_package:303): get_venv_metadata_for_package: 17ms
pipx >(_parsed_package_to_package_or_url:128): cleaned package spec: py3status
pipx >(_symlink_package_apps:112): Force is true. Removing /home/lord/.local/bin/py3-cmd.
pipx >(_symlink_package_apps:112): Force is true. Removing /home/lord/.local/bin/py3status.
  installed package py3status 3.52, installed using Python 3.11.4
  These apps are now globally available
    - py3-cmd
    - py3status
done! ✨ 🌟 ✨

I have following system-wide packages installed:

apt install python3-dbus sudo apt install python-dbus-dev

vzaliva commented 10 months ago

It was the case of missing dependencies. The following commands helped:

pipx inject py3status dbus-python
sudo apt install libcairo2-dev libgirepository1.0-dev
pipx inject py3status pygobject

I think package specification in pip needs to add dependencies for dbus-python and pygobject

lasers commented 10 months ago

If you clicked on (red/error) vpn_status, it should expand with a message similar to your error log. As for missing dependencies, I see this is already documented in vpn_status module.

dbus-python: to interact with dbus pygobject: which in turn requires libcairo2-dev, libgirepository1.0-dev

This is necessary only for vpn_status. I don't think we should add module dependencies to py3status and if we do, there would be several unwanted dependencies. Users should install them manually.

Alternatively, we split up py3status modules into individual packages with additional dependencies. Meh.