HOWTO install Pygtk in Puppy

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
GustavoYz
Posts: 883
Joined: Wed 07 Jul 2010, 05:11
Location: .ar

HOWTO install Pygtk in Puppy

#1 Post by GustavoYz »

Always read new stories about hassle installing PyGtk...
This may help:

1- Run this

Code: Select all

pkg-config --modversion cairo
and get that pyCairo module from oficial website. Install it.

2- Run this

Code: Select all

pkg-config  --modversion gtk+-2.0
and get that version of pygobject module and install it.

3- Then, install same version number of pygtk. If the installation process tells that the system needs another module, install it (it shuold give version numbers too).

Now, copy all the following to a text file (use Geany to check if was copied fine), and exec it by running 'python filename.py'.

Code: Select all

#!/usr/bin/python
import gtk
def on_button_clicked(*args):
    print "Testing pygtk"

window = gtk.Window()
window.connect("delete_event", gtk.main_quit)
window.set_border_width(10)
button = gtk.Button("It works!")
button.connect("clicked", on_button_clicked)
window.add(button)
window.show_all()
gtk.main()
4- If everything goes fine, you'll see a tiny window saying 'It Works!' and printing "Testing pygtk" everytime you hit the button below in the console...
If u dont see this, something went wrong, try again. Pygtk installation from source should take some time, dont trust in it if was "fast" (check version numbers again)

Note that in latest puppies pygtk works without much issue, from the repository (if Lupu based, check ubuntu's deb, same goes for Slack pups).

User avatar
growler
Posts: 209
Joined: Mon 24 Mar 2008, 04:42
Location: Kapiti - New Zealand

pygobject-introspection

#2 Post by growler »

This looks like what I am after but I guess you are talking about the depreciated pygtk bindings for python 2.x .... have you tried to get python 3.x going with gobject-introspection and pygobject?

I have spent days trying to get this going!!

User avatar
GustavoYz
Posts: 883
Joined: Wed 07 Jul 2010, 05:11
Location: .ar

#3 Post by GustavoYz »

It worked the same way here, but i compiled my python 3.x.

Raidersan
Posts: 2
Joined: Fri 09 Mar 2012, 11:41

#4 Post by Raidersan »

Hi,
I am new to Puppy, have some dusty knowledge of the linux distros.
I wanted to run wahcade on Puppy 10 and encountered the GTK error, then found your post.
I am not sure I have missed something but I don't have pkg-config on my Puppy 10?? Did I miss something?
Tx!

User avatar
GustavoYz
Posts: 883
Joined: Wed 07 Jul 2010, 05:11
Location: .ar

#5 Post by GustavoYz »

I think you are missing the devxxx.sfs... Am I right?
Which Puppy version is it?

User avatar
growler
Posts: 209
Joined: Mon 24 Mar 2008, 04:42
Location: Kapiti - New Zealand

#6 Post by growler »

It doesn't seem quite a straightforward as you say:

I have:

Code: Select all

# pkg-config --modversion cairo
1.11.2
# pkg-config --modversion gtk+-2.0
2.24.8
But there is no version of pycairo 1.11.2 - neither is there a version of pygobject of 2.24.8

User avatar
GustavoYz
Posts: 883
Joined: Wed 07 Jul 2010, 05:11
Location: .ar

#7 Post by GustavoYz »

Did u read the doc there?
Those are compatible backwards, main thing is pygtk and what it needs and it tells u if something went wrong (pycairo >= 0.9, e.g.).
If your Puppy has that gtk, it may be a 5.xx serie; in that case is pretty straightforward as i said in the beginning.
Which Puppy is it? Did you tried with official packages?

Raidersan
Posts: 2
Joined: Fri 09 Mar 2012, 11:41

#8 Post by Raidersan »

I am on Puppy 10
Now I am going to sound stupid, but what is devxxx.sfs? I looked through the library of Puppy packages but can't seem to find anything that matches?

User avatar
growler
Posts: 209
Joined: Mon 24 Mar 2008, 04:42
Location: Kapiti - New Zealand

#9 Post by growler »

racy 522.
I am compling python 2.7 and there are only packages for 2.6 that I could find.
I tried with 3 with gtk 3 but couldn't get it all to work - I posted elsewhere about my experiences with that nightmare..

Cairo 1.11 appears not to be compatible with py2cairo1.10.0

Also need tcl/tk to compile python with tkinter and have idle work.

Post Reply