PyGTK em Python 3

330 views
Skip to first unread message

matheus.saraiva

unread,
Sep 14, 2013, 12:24:29 PM9/14/13
to python...@googlegroups.com
PyGTK é compatível com python 3.3?

Copiei um exemplo de Olá mundo, quando rodo com python 2.7 funciona normal, mas quando rodo com python 3.3 da InportError
ImportError: No module named 'pygtk'

Estou usando ubuntu13.04

Rafael Fernandes

unread,
Sep 14, 2013, 12:36:38 PM9/14/13
to python...@googlegroups.com
PyGtk não é compatível com python3, para utilizar o Gtk com python3 você deverá utilizar o PyGObject.

Se não me engano o nome do pacote para ubuntu é python3-gi, basta instalar pelo apt e importar o Gtk.

from gi.repository import Gtk


--
--
------------------------------------
Grupo Python-Brasil
http://www.python.org.br/wiki/AntesDePerguntar
 
<*> Para visitar o site do grupo na web, acesse:
http://groups.google.com/group/python-brasil
 
<*> Para sair deste grupo, envie um e-mail para:
python-brasi...@googlegroups.com
 
---
Você está recebendo esta mensagem porque se inscreveu no grupo "Python Brasil" dos Grupos do Google.
Para cancelar a inscrição neste grupo e parar de receber seus e-mails, envie um e-mail para python-brasi...@googlegroups.com.
Para obter mais opções, acesse https://groups.google.com/groups/opt_out.

Diogo

unread,
Sep 14, 2013, 12:38:42 PM9/14/13
to python...@googlegroups.com
Olá! Tenta dar o comando sudo apt-get install python3-pygtk (acho que é isso). Talvez só tenha o módulo instalado para python 2

Diogo

unread,
Sep 14, 2013, 12:41:33 PM9/14/13
to python...@googlegroups.com
Boa...


Rafael Fernandes <drael...@gmail.com> escreveu:



PyGtk não é compatível com python3, para utilizar o Gtk com python3 você deverá utilizar o PyGObject.

Se não me engano o nome do pacote para ubuntu é python3-gi, basta instalar pelo apt e importar o Gtk.

from gi.repository import Gtk

Gladson Simplício Brito

unread,
Sep 14, 2013, 4:32:07 PM9/14/13
to Python Brasil
Reply all
Reply to author
Forward
0 new messages