Python Forum
PyGtk3, No Module Named gi, on python3.5 on Windows - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: GUI (https://python-forum.io/forum-10.html)
+--- Thread: PyGtk3, No Module Named gi, on python3.5 on Windows (/thread-3327.html)



PyGtk3, No Module Named gi, on python3.5 on Windows - harun2525 - May-15-2017

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


RE: PyGtk3, No Module Named gi, on python3.5 on Windows - metulburr - May-15-2017

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:metulburr@ubuntu:~$ 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.io/en/latest/install.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?


RE: PyGtk3, No Module Named gi, on python3.5 on Windows - harun2525 - May-15-2017

@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.


RE: PyGtk3, No Module Named gi, on python3.5 on Windows - harun2525 - May-16-2017

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.


RE: PyGtk3, No Module Named gi, on python3.5 on Windows - metulburr - May-16-2017

(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?


RE: PyGtk3, No Module Named gi, on python3.5 on Windows - harun2525 - May-17-2017

@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 ?


RE: PyGtk3, No Module Named gi, on python3.5 on Windows - snippsat - May-17-2017

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]


RE: PyGtk3, No Module Named gi, on python3.5 on Windows - harun2525 - May-19-2017

@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


RE: PyGtk3, No Module Named gi, on python3.5 on Windows - snippsat - May-19-2017

(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.