Can one use Clutter with Python 3?
Asked Answered
O

2

6

Are there Python 3 bindings for Clutter? If so, how can I get them and use them?

Objectify answered 4/12, 2011 at 23:1 Comment(1)
I just found this documentation: clutter-and-mx-under-python3.readthedocs.org/en/latest/… which seems to be useful for using clutter with py3. HIHSolenne
O
4

As stated by Lattyware, the way to use Clutter in Python 3 is by installing "GObject introspection" data and allowing GObject to dynamically generate the bindings to the original C library.

On Ubuntu 11.10, install both Python 3 GObject and the GObject introspection data for clutter:

sudo apt-get install python3-gobject gir1.2-clutter-1.0

On Ubuntu 12.04 and later, the python3-gobject package has been renamed to python3-gi:

sudo apt-get install python3-gi gir1.2-clutter-1.0

If you want to install the GTK+ Clutter library:

sudo apt-get install python3-gi gir1.2-gtkclutter-1.0

If using a virtualenv virtual Python environment, use the following command, which allows Python to find the GObject introspection libraries:

virtualenv env -p python3 --system-site-packages

To use Clutter or GtkClutter in Python 3:

from gi.repository import Clutter
from gi.repository import GtkClutter

The package gi.repository is a special package which dynamically generates these Python classes.

Objectify answered 11/4, 2012 at 6:4 Comment(0)
S
3

From what I gather, the answer is to use GObject rather than direct bindings, and PyGObject appears to have a Python 3 branch that apparently works - not that I have used it personally.

You might also want to see this question on using PyGObject with python 3.

Stines answered 4/12, 2011 at 23:10 Comment(1)
I already have python-gobject working with Python 3. I want to know if it's possibly to use clutter with Python 3.Objectify

© 2022 - 2024 — McMap. All rights reserved.