yktoo / indicator-sound-switcher

Sound input/output selector indicator for Linux
https://yktoo.com/en/software/sound-switcher-indicator/
GNU General Public License v3.0
368 stars 29 forks source link

[BUG] snap: 2.3.10 fails to start #134

Closed poschi3 closed 3 weeks ago

poschi3 commented 4 weeks ago

Describe the bug I updated to version 2.3.10 (snap) and indicator-sound-switcher is not starting anymore.

To Reproduce Steps to reproduce the behavior:

  1. Open console
  2. Enter "indicator-sound-switcher"
  3. See error

Expected behavior Indicator is in top bar

Console output

$ indicator-sound-switcher 
Traceback (most recent call last):
  File "/snap/indicator-sound-switcher/150/bin/indicator-sound-switcher", line 33, in <module>
    sys.exit(load_entry_point('indicator-sound-switcher==2.3.10', 'console_scripts', 'indicator-sound-switcher')())
  File "/snap/indicator-sound-switcher/150/lib/python3.6/site-packages/pkg_resources/__init__.py", line 479, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/snap/indicator-sound-switcher/150/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2861, in load_entry_point
    return ep.load()
  File "/snap/indicator-sound-switcher/150/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2465, in load
    return self.resolve()
  File "/snap/indicator-sound-switcher/150/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2471, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/snap/indicator-sound-switcher/150/lib/python3.6/site-packages/indicator_sound_switcher/__init__.py", line 32, in <module>
    from .indicator import SoundSwitcherIndicator, APP_ID, APP_NAME, APP_VERSION
  File "/snap/indicator-sound-switcher/150/lib/python3.6/site-packages/indicator_sound_switcher/indicator.py", line 4, in <module>
    from importlib.metadata import version
ModuleNotFoundError: No module named 'importlib.metadata'

Desktop (please complete the following information):

Indicator config: I have no ~/.config/indicator-sound-switcher.json or ~/snap/indicator-sound-switcher/current/.config/indicator-sound-switcher.json (folder ~/snap/indicator-sound-switcher/current/.config exists)

Indicator log:

$ indicator-sound-switcher -vv
Traceback (most recent call last):
  File "/snap/indicator-sound-switcher/150/bin/indicator-sound-switcher", line 33, in <module>
    sys.exit(load_entry_point('indicator-sound-switcher==2.3.10', 'console_scripts', 'indicator-sound-switcher')())
  File "/snap/indicator-sound-switcher/150/lib/python3.6/site-packages/pkg_resources/__init__.py", line 479, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/snap/indicator-sound-switcher/150/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2861, in load_entry_point
    return ep.load()
  File "/snap/indicator-sound-switcher/150/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2465, in load
    return self.resolve()
  File "/snap/indicator-sound-switcher/150/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2471, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/snap/indicator-sound-switcher/150/lib/python3.6/site-packages/indicator_sound_switcher/__init__.py", line 32, in <module>
    from .indicator import SoundSwitcherIndicator, APP_ID, APP_NAME, APP_VERSION
  File "/snap/indicator-sound-switcher/150/lib/python3.6/site-packages/indicator_sound_switcher/indicator.py", line 4, in <module>
    from importlib.metadata import version
ModuleNotFoundError: No module named 'importlib.metadata'

Additional context Add any other context about the problem here.

poschi3 commented 4 weeks ago

I found out that importlib.metadata was introduced in Python 3.8 and is no longer provisional from 3.10.

I found out, that python in snap environment is to old:

poschi@bart-nb:~$ snap run --shell indicator-sound-switcher
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

poschi@bart-nb:/home/poschi$ python3 --version
Python 3.6.9

From snapcraft.yaml I can see that the package is based on core18 https://github.com/yktoo/indicator-sound-switcher/blob/01018d288999683c5ab8bd47b65e7b5ee4aff219/snap/snapcraft.yaml#L2 which means Ubuntu 18.04 LTS (Bionic Beaver).

May be it is possible to update core version?

piktor commented 3 weeks ago

I have the same issue on 22.04.4 with snap package so I decided to remove snap and install indicator-sound-switcher from PPA.

$ snap remove indicator-sound-switcher

$ sudo apt-add-repository ppa:yktooo/ppa
$ sudo apt-get update
$ sudo apt-get install indicator-sound-switcher

It works fine as my Python version is 3.10.12

$ python3 --version
Python 3.10.12

You may consider this as workaround :-)

yktoo commented 3 weeks ago

Yes I'm aware of the problem and looking for a solution. Unfortunately, switching base in a snap is a hassle (mildly put), because the differences between different bases are huge and poorly documented.

yktoo commented 3 weeks ago

Resolved and released in 2.3.10.1.

poschi3 commented 3 weeks ago

Thank you! It is working fine now :-)