6

I've been trying to install PyGObject using a variety of methods. First, using apt-get but that only installs it for Python 2.x. Next I attempted to compile it myself but I have been having problems getting it to compile for Python 3.

Does anyone know how to install it?

tshepang
  • 12,111
  • 21
  • 91
  • 136
AJ00200
  • 16,327
  • 7
  • 23
  • 21
  • 1
    Any particular reason you need to use Python 3? – agf Aug 15 '11 at 13:29
  • 1
    @agf Need, no, but the software we are creating will take a while to create and by the time it is done, Python 3 will be the default on a few more Linux distributions. Already some of our development team are using OSes which have Python 3 set as the default for Python. – AJ00200 Aug 15 '11 at 14:15
  • 5
    Python 3 seems to be the way to go. – Kudu Aug 15 '11 at 14:31
  • 2
    What problems are you running into building it? The code was written for Python 2 but they use `from __future__` statements to bring in absolute imports from Python 3, so it seems that they've written it to be Python 3-compatible (I haven't exhaustively searched through the code). FWIW, even in Arch Linux, in which Python 3 is the default, only Python 2 bindings for pygojbect are available. –  Aug 16 '11 at 15:00
  • @Brandon Invergo: I am running into all sorts of problems from different install methods I've tried. I'm getting errors about an outdated glib version to missing dependencies from other installers that I can't find. However, it seems that Ubuntu 11.10 will include the latest version of pygobject. Also, I have been informed that pygobject does work with Python 3 on Arch if you install the Python 3 package. I'll just wait until the Ubuntu update and instead work on the backend code for this program. Thanks for the info. – AJ00200 Aug 17 '11 at 02:41
  • The problems you are having with it should be included in the main text of your question. One should not have to read the comments to know what exactly you are asking. – tshepang Aug 20 '11 at 07:34
  • 1
    None of the problem you mention seem to have anything to do with Python 3 at all. – Lennart Regebro Aug 20 '11 at 09:55

1 Answers1

5

First you need to install python3 and the development headers.

Then you need to tell configure to use python3:

PYTHON=python3 ./configure

Compile and install normally

make
make install

You should then be able to use pygobject from python3.

Johan Dahlin
  • 25,300
  • 6
  • 40
  • 55
  • I'm just going to up-vote this for now. I have been informed that Ubuntu 11.10 will include python-gobject for Python 3 in the package repositories. If I get a chance to test this elsewhere and it works I will select it as the answer. It seems that I haven't installed python3-dev if my previous attempts. – AJ00200 Oct 10 '11 at 00:56
  • Ok, this looks like the instructions they now provide on their website. I'll accept it. – AJ00200 Oct 14 '11 at 02:09