Python 3 can't find 'gi' module

John Carlson

This issue began when I was trying to run redshift-gtk. I installed the program manually and it runs fine via just redshift, but I want it to run with the indicator. I always get the following output:

Traceback (most recent call last):
File "/usr/local/bin/redshift-gtk", line 26, in <module>
from redshift_gtk.statusicon import run
File "/usr/local/lib/python3.8/site-packages/redshift_gtk/statusicon.py", line 30, in <module>
import gi
ModuleNotFoundError: No module named 'gi'

I do think this is more of a general problem rather than redshift-specific. I already have the necessary pre-requisites installed:

python3-gi is already the newest version (3.36.0-1)
python3-gi-cairo is already the newest version (3.36.0-1).
gir1.2-gtk-3.0 is already the newest version (3.24.20-0ubuntu1)

I've tried executing locate python3-gi and here's the result:

/snap/gnome-3-28-1804/128/usr/share/doc/python3-gi
/snap/gnome-3-28-1804/128/usr/share/doc/python3-gi-cairo
/snap/gnome-3-28-1804/128/usr/share/doc/python3-gi/changelog.Debian.gz
/snap/gnome-3-28-1804/128/usr/share/doc/python3-gi/copyright
/snap/gnome-3-28-1804/128/usr/share/doc/python3-gi-cairo/copyright
/usr/share/doc/python3-gi
/usr/share/doc/python3-gi-cairo
/usr/share/doc/python3-gi/changelog.Debian.gz
/usr/share/doc/python3-gi/copyright
/usr/share/doc/python3-gi-cairo/changelog.Debian.gz
/usr/share/doc/python3-gi-cairo/copyright
/var/lib/dpkg/info/python3-gi-cairo.list
/var/lib/dpkg/info/python3-gi-cairo.md5sums
/var/lib/dpkg/info/python3-gi.list
/var/lib/dpkg/info/python3-gi.md5sums
/var/lib/dpkg/info/python3-gi.postinst
/var/lib/dpkg/info/python3-gi.prerm

So I have no idea why I am having a "No module named 'gi'" error. I also have python-gobject installed:

python-gobject is already the newest version (3.34.0+2.28.6-14ubuntu1)

Here's my current linux version:

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:    20.04
Codename:   focal

What could be wrong here?

N0rbert

At first you should know that RedShift is packaged in all Ubuntu versions.

To remove locally installed stuff use:

sudo python3.8 -m pip uninstall redshift-gtk
sudo rm /usr/local/bin/redshift
sudo rm /usr/local/bin/redshift-gtk

So you can simply install RedShift from repository with:

sudo apt-get install redshift redshift-gtk

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Can't find module in python

From Dev

How to install gi module for anaconda python3?

From Dev

Can't find the test module in Anaconda Python

From Java

Python can't find module in the same folder

From Dev

Python can't find my module

From Dev

Python can't find local module

From Dev

Python Can't Find Wolframalpha Module

From Dev

Why can't python find my module?

From Dev

Can't find the test module in Anaconda Python

From Dev

Can't find Selenium module running Python

From Dev

Python can't find my custom module

From Dev

Python module 'gi' not found on Arch

From Dev

Python GI module cannot be imported

From Dev

Python can't find a module, that is imported in another module

From Dev

Can't find '_sqlite3' module when import it using python which installed by pyenv

From Dev

Why can python3 not import gi.repository?

From Dev

CMake can't find python3

From Dev

Received 'can't find '__main__' module in '<packageName>' with python package

From Dev

python setuptools entry point script can't find module

From Dev

python flask can't find '__main__' module in ''

From Dev

Can't find module cPickle using Python 3.5 and Anaconda

From Dev

Can't find split() method or replacement in string module in python 3.4.1?

From Dev

Python virtual environment, can't find '__main__' module in

From Dev

Python package gi is not found, although python3-gi is installed

From Dev

Titanium can't find module

From Dev

importlib can't find module

From Dev

PerlLoadModule can't find module

From Dev

Can't find module Bootstrap

From Dev

Can't find module 'dust'