Python Forum
PyGtk3, No Module Named gi, on python3.5 on Windows
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PyGtk3, No Module Named gi, on python3.5 on Windows
#1
hi i have a great problem I insalled python3.5 and deleted python3.4 and installed pygobject3.18.2 on python3.5 64 bit but after installation, when I import gi module, python give no module named error! please help me.  Cry Cry Cry
Reply
#2
Quote:when I import gi module, python give no module named error
Are you sure you are using the python3.5 interpreter when you get this error? If you are using an IDE, verify that the interpreter is changed to the new one. 

did you install pyobject from your distro's repos?
Quote:[email protected]:~$ sudo apt-cache search pygobject
python-gi-dev - development headers for GObject Python bindings
python-glade2 - GTK+ bindings: Glade support
python-gobject-2-dev - development headers for the static GObject Python bindings
python-gtk2 - Python bindings for the GTK+ widget set
python-gtk2-dbg - Python bindings for the GTK+ widget set (debug extension)
python-gtk2-dev - GTK+ bindings: devel files
python-gtk2-doc - Python bindings for the GTK+ widget set - documentation
python-gtkspellcheck - spellchecking library written in Python for Gtk based on Enchant
python-gtkspellcheck-doc - Python GTK Spellcheck common documentation
python3-gtkspellcheck - spellchecking library written in Python for Gtk based on Enchant
and go through their install process?
http://python-gtk-3-tutorial.readthedocs...stall.html
Quote:hi i have a great problem I insalled python3.5 and deleted python3.4
Why would you do this? Is there some feature you wanted to use in python3.5.x?
Reply
#3
@metulburr,

yes, python3.5 allows {**ab, **bc} expression and this is important to me

in my pc there are two os, first: windows, second: fedora, there is no any error with gtk3 in fedora on python3.5. but python3.5 on my windows7 giving this error. why does same python version give error on windows and why doesn't give any error on fedora ?

i can't install from repo because this problem in windows7 so i installed offical pygobject3.18.2 version for windows.
Reply
#4
i met new problem, i installed pygtk3 on python3.5 and pygtk3 gave new error:

>>> import gi
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\Python35\lib\site-packages\gi\__init__.py", line 42, i
 <module>
    from . import _gi
ImportError: Module use of python34.dll conflicts with this version of Python.
please help me.

up to date.
Reply
#5
(May-16-2017, 09:04 PM)harun2525 Wrote: ImportError: Module use of python34.dll conflicts with this version of Python.
Is Python3.5 in your PATH?
Reply
#6
@metulburr,

yes. 

i didn't understand, python3.5 on fedora can contain pygtk3 module but python3.5 on windows can't contain pygtk3. why same version do this on different os ?
Reply
#7
Follow this
What this dos is build a full environment with Python3.5 and Python 2.7.
So it can be a little confusing,you don't use your own Python OS installation.
pacman command build full environment. 

After i follow the steps, have all in C:\msys32\mingw32\bin
So i save gtk_test.py in that folder
#gtk_test.py
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk

window = Gtk.Window(title="Hello World")
window.show()
window.connect("delete-event", Gtk.main_quit)
Gtk.main()
Now i can choose to run with 3.5 or 2.7 both work(they are build from scratch).
[Image: 5WsZZG.jpg]
[Image: sfmTal.jpg]
Reply
#8
@snippsat,


thanks for answer yes perhaps it works but this solution requires disk space too much,

I'll try.

I can't install python3.5 to msys2
Reply
#9
(May-19-2017, 08:56 AM)harun2525 Wrote: I can't install python3.5 to msys2
You don't install python3.5,it's get built. 
In this link same approach,you can build for only Python 3.5.
Quote:If you develop in Python 3:
pacman -S mingw-w64-x86_64-python3-gobject

Not using pacman and build this yourself(Visual Studio) can be nightmare.
The size will be somewhat large anyway,PyGObject(GTK 3+) has dependencies of at least 20 libraries.
Look at this blog.

Up to Python 3.4 there are "exe" build here.
This is what you have used before.
It install into a exciting Python 3.4 install.

Tool over do it in a other way,they build all PyGObject including Python 3.5.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] ModuleNotFoundError: No module named 'PyQt5' matklt 2 3,687 Jun-02-2020, 07:05 AM
Last Post: Knight18
  [WxPython] Linux: No module named 'wx' PeterLinux 23 3,861 Apr-02-2020, 12:50 PM
Last Post: PeterLinux
  [Kivy] ModuleNotFoundError: No module named 'kivy' Exsul 7 16,520 Mar-30-2019, 12:58 AM
Last Post: Exsul
  "ModuleNotFoundError: No module named '_tkinter' in Python 3.8 Alfa 0 programmerc 1 3,383 Oct-21-2018, 06:32 PM
Last Post: Larz60+
  a suitable bluetooth module for python3 for transfering file gray 3 2,456 Jul-22-2017, 12:13 PM
Last Post: Larz60+
  pygtk3, how to change application theme ? harun2525 7 4,347 May-10-2017, 08:42 PM
Last Post: harun2525
  PyGtk3, How to Create “title-changed” signal for Gtk.Window Widget? harun2525 2 3,561 May-01-2017, 07:59 AM
Last Post: harun2525
  PyGTK3, I can't Change Button and Table Backgorund Color using modify_bg method. harun2525 3 5,667 Apr-24-2017, 04:05 PM
Last Post: changos
  PyGTK3, How to Print All Existing Signal ? harun2525 1 1,726 Apr-16-2017, 02:57 PM
Last Post: Larz60+
  [Tutorial] PyGtk3 How To Change Applicaton Theme harun2525 0 2,095 Apr-15-2017, 11:16 AM
Last Post: harun2525

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020