Gnome tweaks error

Hi all,
I am new manjaro
I have installed Gnome tweaks in my machine.
But when I try to run it, the below error is shown.

Traceback (most recent call last):
File “/usr/bin/gnome-tweaks”, line 17, in
import gtweak
ModuleNotFoundError: No module named ‘gtweak’

Can anyone help with this

Hi @NDN, and welcome!

How did you install it?


Tip:

If you provide any terminal output, paste it here, enclosed in three (3) backticks (```) before and after the text. Like this:

```
pasted text
```

This will just cause it to be rendered like this:

Morbi eu condimentum
et orci
fusce tortor enim enim condimentum
diam cursus lacus
sollicitudin interdum.

instead of like this:

Morbi eu condimentum et orci fusce tortor enim enim condimentum diam cursus lacus sollicitudin interdum.

Thereby improving legibility and making it much easier for those trying to provide assistance.

2 Likes

I installed it via both apps and software and terminal

‘’’
sudo Pacman -S gnome-tweaks

‘’’

There were no error are the time

When I open the tweaks app from the menu
The busy icon in mouse only appears but the app is not opening
When I try to open it in terminal the below error shown.

‘’’
Traceback (most recent call last):
File “/usr/bin/gnome-tweaks”, line 17, in
import gtweak
ModuleNotFoundError: No module named ‘gtweak’

‘’’

I have also read something about building packages
But I don’t know how to do that.

Anything else let me know.
Thanks,
NDN

Try installing it with pamac:

pamac install gnome-tweaks

I don’t know if it’ll work, but it’s worth a shot.


P.S.:

Thank you for the terminal output. I meant, bacticks, a.k.a. accent mark, a.k.a grave accent, and not the single-quote character. ( ` and not ’ ). If using the en_US keyboard layout, as me, that is the key just to the left of the 1:

Test it, and you’ll see.


Also remember, Linux, thus Majaro is case-sensitive. So,

sudo Pacman -S gnome-tweaks

is not the same as:

sudo pacman -S gnome-tweaks

and will fail.

Thanks for the Reply,
But sadly it doesn’t work

sudo pamac install gnome-tweaks                                  ✔ 
[sudo] password for ndn: 
Preparing...
Warning: gnome-tweaks-40.0-2 is up to date -- skipping
Nothing to do.
Transaction successfully finished.
    ~  gnome-tweaks                                              ✔  8s  
Traceback (most recent call last):
  File "/usr/bin/gnome-tweaks", line 18, in <module>
    import gtweak
ModuleNotFoundError: No module named 'gtweak'

I have also installed it from the Arch Linux site but no change.

Any idea.

Thanks

No ideas. But a quick search led me here, where, and I don’t know if this works or what it’ll do but there is something to try, at least:

Try setting your locales if you haven’t already. Locale - ArchWiki

If that doesn’t work, 1) make sure your repos on your mirrorlist are updated and update, 2) look at the Archwiki re python2 to see if there’s any troubleshooting, 3) try some of the renaming paths in your tweak.bin file in some of those threads as a last resort (this shouldn’t be necessary; I have gnome on Arch and I’ve never had an issue with the tweak tool).

Sorry I can’t be of more help.


Edit:

After some more digging, I came across this page, where:

The error you are getting indicates that the code has the wrong version of libhandy.

So I don’t know which version is necessary nor which one you have, but it might be something to check out.

@NDN Share the output of cat /usr/bin/gnome-tweaks.

Hi this is the output of the line /usr/bin/gnome-tweaks

Traceback (most recent call last):
  File "/usr/bin/gnome-tweaks", line 14, in <module>
    import gi
ModuleNotFoundError: No module named 'gi'

Hope it helps in solving the issue

See

So reinstall anaconda?

:man_shrugging:

1 Like

output of cat /usr/bin/gnome-tweaks. see the cat.

cat /usr/bin/gnome-tweaks
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-3.0+
# License-Filename: LICENSES/GPL-3.0

import gettext
import logging
import locale
import os.path
import optparse
import signal
import sys

import gi
gi.require_version("Gtk", "3.0")
gi.require_version("Handy", "1")

import gtweak
from gtweak.defs import VERSION


if __name__ == '__main__':
    parser = optparse.OptionParser(version=VERSION)
    parser.add_option("-t", "--test", action="store_true",
                      help="Enable test and debug code")
    parser.add_option("-l", "--load", action="store_true",
                      help="Load all tweaks")
    parser.add_option("-p", "--prefix",
                      help="Installation prefix (for gsettings schema, themes, etc)",
                      metavar="[/, /usr]")
    parser.add_option("-v", "--verbose", action="store_true",
                      help="Print the names of settings modified")
    parser.add_option("-d", "--debug", action="store_true",
                      help="Enable debug output")
    options, args = parser.parse_args()

    try:
        from gtweak.defs import GSETTINGS_SCHEMA_DIR, TWEAK_DIR, DATA_DIR, \
                                PKG_DATA_DIR, LOCALE_DIR, LIBEXEC_DIR
        _defs_present = True
    except ImportError:
        GSETTINGS_SCHEMA_DIR = TWEAK_DIR = DATA_DIR = PKG_DATA_DIR = \
                               LOCALE_DIR = LIBEXEC_DIR = ""
        _defs_present = False

    # the supplied prefix always beats the contents of defs
    if options.prefix or not _defs_present:
        _prefix = options.prefix or "/usr"
        DATA_DIR = os.path.join(_prefix, "share")
        LOCALE_DIR = os.path.join(_prefix, "share", "locale")
        GSETTINGS_SCHEMA_DIR = os.path.join(_prefix, "share", "glib-2.0", "schemas")
        _me = os.path.abspath(os.path.dirname(__file__))
        TWEAK_DIR = os.path.join(_me, "gtweak", "tweaks")
        PKG_DATA_DIR = os.path.join(_me, "data")

    gtweak.GSETTINGS_SCHEMA_DIR = GSETTINGS_SCHEMA_DIR
    gtweak.TWEAK_DIR = TWEAK_DIR
    gtweak.DATA_DIR = DATA_DIR
    gtweak.PKG_DATA_DIR = PKG_DATA_DIR
    gtweak.LOCALE_DIR = LOCALE_DIR
    gtweak.LIBEXEC_DIR = LIBEXEC_DIR
    gtweak.ENABLE_TEST = options.test
    gtweak.ALL_TWEAKS = options.load
    gtweak.APP_NAME = "gnome-tweaks"
    gtweak.VERBOSE = options.verbose

    if options.debug:
        level = logging.DEBUG
    else:
        level = logging.WARNING
    logging.basicConfig(format="%(levelname)-8s: %(message)s", level=level)

    locale.setlocale(locale.LC_ALL, None)
    gettext.install(gtweak.APP_NAME, LOCALE_DIR, names=('gettext', 'ngettext'))

    from gtweak.app import GnomeTweaks
    app = GnomeTweaks()
    signal.signal(signal.SIGINT, signal.SIG_DFL)
    exit_status = app.run(None)
    sys.exit(exit_status)

Done, no use

The file is fine. Just last then problem can be solved

output of which -a python && echo "\n\n" && which -a python3

which -a python && echo "\n\n" && which -a python3
/usr/bin/python



/usr/bin/python3

I have similar outputs to all those commands but can’t find what’s wrond. @Yochanan looks over gnome related stuff. Maybe they can help.

Just for giggles, try anaconda2. It’s also in the AUR:

$ pamac search anaconda
anaconda2                                                                                                                                                                                                                                    2019.10-1  AUR
Completely free enterprise-ready Python distribution for large-scale data processing, predictive analytics, and scientific computing.
anaconda                                                                                                                                                                                                                                     2021.05-1  AUR
Completely free enterprise-ready Python distribution for large-scale data processing, predictive analytics, and scientific computing.

So, can be installed using:

pamac build anaconda2

:man_shrugging:

Don’t really have much to lose at this stage.


If you wish to remove it afterward:

(Only do this if you don’t have it installed currently and don’t want to keep it if it doesn’t help.)

pamac remove anaconda2

@Mirdarthos this should work too

https://askubuntu.com/a/106453

change #!/usr/bin/env python to #!/usr/bin/python

Possible. I wouldn’t know. @NDN can test for us.

Hi all sorry to say this but as a new user I have freshly install the OS again now the problem solved

Thanks for your time

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