Search code examples
pythonpygtkpygobjectgnuradiogobject

PyGTK Issue when Installing GNURadio


I am trying to install GNURadio through PyBOMBS in a virtualenv. When I run pybombs prefix init ~/prefix -a myprefix -R gnuradio-default, the installation fails with

-- Python checking for pygtk >= 2.10.0 - not found

After seeing this, I tried to install PyGTK. I first installed pycairo through pip using instructions from this GitHub issue, then pygobject with pip install pygobject. After doing these two things, I am able to import cairo and import gi but unable to import gobject. However, I successfully built and installed pygtk from source following these instructions.

After installing these things, the PyBOMBS installer still yields the same error message about not finding PyGTK. I have linked the full PyBOMBS output here.

I have also tried installing python-gtk2-dev, python-gi, python-gi-cairo, and gir1.2-gtk-2.0 through apt, though I would prefer not to install packages globally if possible. PyBOMBS yielded the same output after installing those apt packages.

I've been ripping my hair out over this for the last two days, so I greatly appreciate any and all suggestions y'all have :)


Solution

  • I am assuming that the PyBOMBS tool will install any required dependencies so you should not have to.

    I ran the following commands which seemed to work on an Ubuntu 16.04 system.

    virtualenv venv
    source venv/bin/activate
    pip install pybombs
    pybombs auto-config
    pybombs recipes add-defaults
    pybombs prefix init ~/prefix -a myprefix -R gnuradio-default
    

    Edit: After checking my logs I realized that I was mistaken, and that the build process hadn't even started, and I had a similar errors as the OP.

    After consulting Installing PyGtk in virtualenv I added the following symlinks in my venv/lib/python2.7:

    ln -s /usr/lib/python2.7/dist-packages/gtk-2.0/gio/
    ln -s /usr/lib/python2.7/dist-packages/glib
    ln -s /usr/lib/python2.7/dist-packages/gobject
    ln -s /usr/lib/python2.7/dist-packages/gtk-2.0/gtk
    ln -s /usr/lib/python2.7/dist-packages/gtk-2.0/
    ln -s /usr/lib/python2.7/dist-packages/lxml
    ln -s /usr/lib/python2.7/dist-packages/pygtk.pth
    ln -s /usr/lib/python2.7/dist-packages/pygtk.py
    ln -s /usr/lib/python2.7/dist-packages/PyQt4
    

    After rerunning pybombs prefix init ~/prefix -a myprefix -R gnuradio-default this successfully managed to build.

    Note: Creating the virtualenv with --system-site-packages did not work as pybombs failed on assertions.