GradienceTeam / Gradience

Change the look of Adwaita, with ease
https://gradienceteam.github.io
GNU General Public License v3.0
1.3k stars 47 forks source link

bug: imp Module error #890

Open niksingh710 opened 4 months ago

niksingh710 commented 4 months ago

Is there an existing issue for this?

What happened?

After recent update of python on arch linux

Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/yapsy/PluginManager.py", line 132, in <module>
    import importlib.abc.Loader as imp
ModuleNotFoundError: No module named 'importlib.abc.Loader'; 'importlib.abc' is not a package

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/gradience", line 70, in <module>
    from gradience.frontend import main
  File "/usr/lib/python3.12/site-packages/gradience/frontend/main.py", line 37, in <module>
    from gradience.frontend.views.plugins_list import GradiencePluginsList
  File "/usr/lib/python3.12/site-packages/gradience/frontend/views/plugins_list.py", line 22, in <module>
    from yapsy.PluginManager import PluginManager
  File "/usr/lib/python3.12/site-packages/yapsy/PluginManager.py", line 134, in <module>
    import imp
ModuleNotFoundError: No module named 'imp'

To Reproduce

update python to latest on arch linux and try running gradience.

Expected behavior

No response

Screenshots

No response

OS

Arch Linux

DE/WM version

Hyprland

Version

Gradience, version 0.8.0-beta2

Installation method

AUR

Enabled system extensions (GNOME specific)

No response

Additional context

No response

Code of Conduct

github-actions[bot] commented 4 months ago

Welcome on Gradience. 🥳 We really appreciate your contribution. The core team will review your issue as soon as possible. You can also join the Matrix room: https://matrix.to/#/#Gradience-space:envs.net or the Discord server: https://discord.com/invite/4njFDtfGEZ

niksingh710 commented 4 months ago

https://docs.python.org/3.11/library/imp.html

imp has been removed in favour of importlib.

allomanta commented 4 months ago

I had this same issue but changing

import importlib.abc.Loader as imp

to

from importlib.abc import Loader as imp

in /usr/lib/python3.12/site-packages/yapsy/PluginManager.py resolved this error for me so that Gradience launches. However, I now get a new error:

AttributeError: type object 'Loader' has no attribute 'PY_SOURCE'
[yapsy] Unable to import plugin: /usr/share/gradience/plugins/firefox_gnome_theme
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/yapsy/PluginManager.py", line 518, in loadPlugins
    candidate_module = PluginManager._importModule(plugin_module_name, candidate_filepath)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/yapsy/PluginManager.py", line 584, in _importModule
    candidate_module = imp.load_module(plugin_module_name,plugin_file,candidate_filepath+".py",("py","r",imp.PY_SOURCE))

and styles seem to only partially get applied (the sidebar in nautilus changes colors but not much else) , but that might be something else.

Almamu commented 4 months ago

yapsy seems to have an open issue related to this: https://github.com/tibonihoo/yapsy/issues/19

Vixima commented 4 months ago

yapsy seems to have an open issue related to this: tibonihoo/yapsy#19

it also seems like they're looking for a new maintainer for yapsy... tibonihoo/yapsy#23

ShiftHackZ commented 4 months ago

As a temporary workaround, installing this aur package allows to run gradience. https://aur.archlinux.org/packages/python-zombie-imp