quodlibet icon indicating copy to clipboard operation
quodlibet copied to clipboard

Error in Fedora 39 related to "importhelper" and "find_loader"

Open rednael17 opened this issue 1 year ago • 11 comments

Steps to reproduce

After installing quodlibet through dnf install quodlibet, the program fails to open. I know the issue is most likely on my end, but attempting fixes through reinstalling python did not work. Any help is greatly appreciated.

Actual Output

Running through the terminal, I get:

E: [0000.038] util.importhelper.load_dir_modules: importhelper.py:95:load_module: AttributeError: module 'importlib' has no attribute 'find_loader'
E: [0000.039] util.importhelper.load_dir_modules: importhelper.py:95:load_module: AttributeError: module 'importlib' has no attribute 'find_loader'
E: [0000.039] util.importhelper.load_dir_modules: importhelper.py:95:load_module: AttributeError: module 'importlib' has no attribute 'find_loader'
E: [0000.040] util.importhelper.load_dir_modules: importhelper.py:95:load_module: AttributeError: module 'importlib' has no attribute 'find_loader'
E: [0000.040] util.importhelper.load_dir_modules: importhelper.py:95:load_module: AttributeError: module 'importlib' has no attribute 'find_loader'
E: [0000.040] util.importhelper.load_dir_modules: importhelper.py:95:load_module: AttributeError: module 'importlib' has no attribute 'find_loader'
E: [0000.041] util.importhelper.load_dir_modules: importhelper.py:95:load_module: AttributeError: module 'importlib' has no attribute 'find_loader'
E: [0000.041] util.importhelper.load_dir_modules: importhelper.py:95:load_module: AttributeError: module 'importlib' has no attribute 'find_loader'
E: [0000.041] util.importhelper.load_dir_modules: importhelper.py:95:load_module: AttributeError: module 'importlib' has no attribute 'find_loader'
E: [0000.042] util.importhelper.load_dir_modules: importhelper.py:95:load_module: AttributeError: module 'importlib' has no attribute 'find_loader'
E: [0000.042] util.importhelper.load_dir_modules: importhelper.py:95:load_module: AttributeError: module 'importlib' has no attribute 'find_loader'
E: [0000.043] util.importhelper.load_dir_modules: importhelper.py:95:load_module: AttributeError: module 'importlib' has no attribute 'find_loader'
E: [0000.043] util.importhelper.load_dir_modules: importhelper.py:95:load_module: AttributeError: module 'importlib' has no attribute 'find_loader'
E: [0000.043] util.importhelper.load_dir_modules: importhelper.py:95:load_module: AttributeError: module 'importlib' has no attribute 'find_loader'
E: [0000.044] util.importhelper.load_dir_modules: importhelper.py:95:load_module: AttributeError: module 'importlib' has no attribute 'find_loader'
E: [0000.044] util.importhelper.load_dir_modules: importhelper.py:95:load_module: AttributeError: module 'importlib' has no attribute 'find_loader'
E: [0000.044] util.importhelper.load_dir_modules: importhelper.py:95:load_module: AttributeError: module 'importlib' has no attribute 'find_loader'
No formats found!

Test System

Which version of Quod Libet?

quodlibet-4.6.0-2.3.noarch

Which operating system

Fedora Linux 39 (KDE Plasma) x86_64 Plasma 5.27.10

Python 3.12.1 Wayland

rednael17 avatar Jan 31 '24 19:01 rednael17

I am guessing that something with your python installation is broken, but I can't replicate that on fedora 39 and Xfce. Could it be something with X11 and Wayland?

hannes101 avatar Feb 02 '24 20:02 hannes101

Hmm looks like that call was actually deprecated back in Python 3.4.

What version of Python are you using here?

Will have to look at the code to see why this hasn't come up before

declension avatar Feb 03 '24 13:02 declension

Hmm looks like that call was actually deprecated back in Python 3.4.

What version of Python are you using here?

Will have to look at the code to see why this hasn't come up before

Python 3.12.1

Package: python-unversioned-command-3.12.1-2.fc39.noarch

rednael17 avatar Feb 05 '24 23:02 rednael17

I am guessing that something with your python installation is broken, but I can't replicate that on fedora 39 and Xfce. Could it be something with X11 and Wayland?

That is certainly an idea. I'm using Wayland. Any idea how to check this? Removing and reinstalling Python yielded no results.

rednael17 avatar Feb 05 '24 23:02 rednael17

Seems this was removed in 3.12: https://docs.python.org/3/whatsnew/3.12.html#importlib

lazka avatar Feb 07 '24 04:02 lazka

I no longer get the error after reinstalling QuodLibet some time later, but I'm not sure as to why that is.

rednael17 avatar Feb 27 '24 20:02 rednael17

I do get the error on Fedora 39 and cannot run quodlibet. Any workaround would be appreciated

st1mhack avatar Feb 27 '24 22:02 st1mhack

After updating to quodlibet-4.6.0-2.3.noarch, I now get an error again:

Traceback (most recent call last):
  File "/usr/bin/quodlibet", line 14, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.12/site-packages/quodlibet/main.py", line 25, in main
    quodlibet.init_cli(config_file=config_file)
  File "/usr/lib/python3.12/site-packages/quodlibet/_init.py", line 135, in init_cli
    config.init(config_file)
  File "/usr/lib/python3.12/site-packages/quodlibet/config.py", line 387, in init
    _config.read(filename)
  File "/usr/lib/python3.12/site-packages/quodlibet/util/config.py", line 380, in read
    self._config.readfp(fileobj, filename)
    ^^^^^^^^^^^^^^^^^^^
AttributeError: 'RawConfigParser' object has no attribute 'readfp'. Did you mean: 'read'?

I do get the error on Fedora 39 and cannot run quodlibet. Any workaround would be appreciated

Can you test it after dnf update and confirm this error?

rednael17 avatar Feb 28 '24 11:02 rednael17

still happens after dnf update and reboot

st1mhack avatar Feb 28 '24 12:02 st1mhack

What does python --version show from the command line on your installations? It should be python --version Python 3.12.2

hannes101 avatar Mar 03 '24 07:03 hannes101

i see, it's only Python 3.12.1 for me.

st1mhack avatar Mar 03 '24 08:03 st1mhack

Just for the record - patch https://github.com/quodlibet/quodlibet/commit/a8b6f6bb34864a6821174edbf7802b689e440db3 fixes these python 3.12 issues for me. It is not in the current 4.6.0 release but could be (should have been?) picked up by fedora.

berndf avatar Mar 09 '24 12:03 berndf

Yes, it's part of the package in fedora 39, so I don't know why it's failing for some users. https://src.fedoraproject.org/rpms/quodlibet/tree/f39

hannes101 avatar Mar 09 '24 13:03 hannes101

I don't know. The dnf package still results in the error I mentioned above for me:

Traceback (most recent call last):
  File "/usr/bin/quodlibet", line 14, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.12/site-packages/quodlibet/main.py", line 25, in main
    quodlibet.init_cli(config_file=config_file)
  File "/usr/lib/python3.12/site-packages/quodlibet/_init.py", line 135, in init_cli
    config.init(config_file)
  File "/usr/lib/python3.12/site-packages/quodlibet/config.py", line 387, in init
    _config.read(filename)
  File "/usr/lib/python3.12/site-packages/quodlibet/util/config.py", line 380, in read
    self._config.readfp(fileobj, filename)
    ^^^^^^^^^^^^^^^^^^^
AttributeError: 'RawConfigParser' object has no attribute 'readfp'. Did you mean: 'read'?

This is with Python 3.12.2.

The flathub flatpak version of QuodLibet works for me without errors.

rednael17 avatar Mar 09 '24 15:03 rednael17

Yes. Exactly that 'readfp' is replaced by 'read_file' by the patch, so it cannot be applied.

berndf avatar Mar 09 '24 15:03 berndf

What does the following show on your system, @rednael17 : rpm -qf /usr/bin/quodlibet

This file should be owned by the package from the repo, so:

rpm -qf /usr/bin/quodlibet
quodlibet-4.6.0-1.fc39.noarch

hannes101 avatar Mar 09 '24 17:03 hannes101

What does the following show on your system, @rednael17 : rpm -qf /usr/bin/quodlibet

This file should be owned by the package from the repo, so:

rpm -qf /usr/bin/quodlibet
quodlibet-4.6.0-1.fc39.noarch
rpm -qf /usr/bin/quodlibet
quodlibet-4.6.0-2.3.noarch

rednael17 avatar Mar 09 '24 19:03 rednael17

This does not seem to be from the repos, so I think this rpm installed the unpatched file, which does not work. I think this is the rpm from lazkas repo, based on the latest quodlibet release, which does not incorporate the patch.

hannes101 avatar Mar 09 '24 19:03 hannes101

This does not seem to be from the repos, so I think this rpm installed the unpatched file, which does not work. I think this is the rpm from lazkas repo, based on the latest quodlibet release, which does not incorporate the patch.

Gotcha, thanks. The quodlibet-4.6.0-1.fc39 package works just fine. But I guess this means that any user installing the program through dnf install quodlibet on F39 will get the lazka version that does not work?

rednael17 avatar Mar 09 '24 21:03 rednael17

No, this package must've been installed on purpose and/or the repo added manually. Normally, the package from the repos should be installed by default. @st1mhack which package do you have installed?

hannes101 avatar Mar 09 '24 21:03 hannes101

No, this package must've been installed on purpose and/or the repo added manually. Normally, the package from the repos should be installed by default. @st1mhack which package do you have installed?

Ah, I think I know why this happened to me. https://quodlibet.readthedocs.io/en/quodlibet-4.6/downloads.html#fedora has a dead link (https://packages.fedoraproject.org//quodlibet/overview/) to the official repos. So I added the Fedora stable repo instead (from lazka) and got the error. At least that's my guess.

rednael17 avatar Mar 09 '24 23:03 rednael17

when I run sudo yum install quodlibet or sudo dnf install quodlibet on my F39, it installs quodlibet-4.6.0-2.3.noarch and I do recall adding that Lazka repo beforehand. So now I have to figure out how to change repos again, I guess..?


Update: Removing the lazka repo and re-installing quodlibet got me quodlibet-4.6.0-1.fc39.noarch executing quodlibet now yields $ quodlibet E: [0000.888] errorreport.main.errorhook: unity.py:46:init: gi.repository.GLib.GError: g-invoke-error-quark: Could not locate unity_launcher_entry_get_for_desktop_id: 'unity_launcher_entry_get_for_desktop_id': /usr/bin/python3: undefined symbol: unity_launcher_entry_get_for_desktop_id (1)

So following #3488, I also had libunity installed though I don't know why. Removing libunity finally got it to launch! Now I hope that did not break any other dependency.

st1mhack avatar Mar 14 '24 14:03 st1mhack