Unable to import Gedit in a Python script
 

Unable to import Gedit in a Python script

 
I am getting the following error when running a Python script:

Code:

[email protected]:~/.local/share/gedit/plugins$ python intelligent_text_completion.py
intelligent_text_completion.py:13: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk, GObject, Gedit, PeasGtk
Traceback (most recent call last):
  File "intelligent_text_completion.py", line 13, in
    from gi.repository import Gtk, GObject, Gedit, PeasGtk
  File "/usr/lib/python2.7/dist-packages/gi/importer.py", line 133, in load_module
    'introspection typelib not found' % namespace)
ImportError: cannot import name Gedit, introspection typelib not found


I tried running sudo apt-get install gedit and I also installed gtk2.0+ and gtk3.0+ and nothing seems to work. I did also ran sudo apt-get install python-gi. Interestingly, I’m able to import GObject but not Gedit:

Code:

[email protected]:~/.local/share/gedit/plugins$ python intelligent_text_completion.py
intelligent_text_completion.py:13: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
  from gi.repository import Gtk, GObject, Gedit, PeasGtk
Traceback (most recent call last):
  File "intelligent_text_completion.py", line 13, in
    from gi.repository import Gtk, GObject, Gedit, PeasGtk
  File "/usr/lib/python2.7/dist-packages/gi/importer.py", line 133, in load_module
    'introspection typelib not found' % namespace)
ImportError: cannot import name Gedit, introspection typelib not found


I have no idea what to do. Can anyone help?

 

Previous [ubuntu] Having strange screen issues, not sure if monitor or OS related
Next [ubuntu] Desire to increase text size under desktop icons
 

About author

You might also like

Ubuntu Dsicussions 0 Comments

LibreOffice install costum

Have tried allot already but doesn’t seem to do what i want, i’m trying to install the latest libreoffice on the terminal with full dutch support and also dutch spelling

Ubuntu Dsicussions 0 Comments

Gnome ubuntu 20.04 icons missing

I want to start off by saying that if I click on the deal on the bottom of the icon bar to show all of your applications I have an

Ubuntu Dsicussions 0 Comments

ipv4 listening ports

Hi, We have an application that needs ports listening to 80/443 to requests a ceritificate, we thought that the issue is on the external facing since the public IP is

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply