WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: pygobject  (Read 5857 times)

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14801
pygobject
« on: January 20, 2013, 04:22:15 AM »
I'm struggling with pygobject - it appears to compile without errors, but:
Code: [Select]
$ echo "0000" | simple-agent hci0 00:1B:66:00:31:88
Traceback (most recent call last):
  File "/usr/local/bin/simple-agent", line 5, in <module>
    from gi.repository import GObject
ImportError: No module named gi.repository

This error does not happen with the 32-bit version, pygobject-2.7, using core and even when I load pygobject-2.7 in corepure64 (which would eventually fail due to the 32-bit libs) I get the same error.

I'm wondering if this is something to do with python and 64bit (maybe it looks by default in /usr/local/lib64/python2.7/site-packages for example), but don't know anything about python, let alone debugging it.

Maybe somebody could help out with some basic python debugging suggestions - which physical file corresponds to the gi.repository module, etc?

Of course if a scripting hero would like to have a go at emulating simple-agent without python and it's friends or, better still, take a punt at an fltk gui, please be my guest  ;)

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14801
Re: pygobject
« Reply #1 on: January 20, 2013, 06:21:39 AM »
Ah-ha:
Code: [Select]
$ python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
/tmp/tcloop/python/usr/local/lib/python2.7/site-packages

..but:
Code: [Select]
$ sudo cp /tmp/tcloop/python/usr/local/bin/* /usr/local/bin

$ python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
/usr/local/lib/python2.7/site-packages

Does anybody know of a more elegant solution than this?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: pygobject
« Reply #2 on: January 20, 2013, 10:02:21 AM »

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14801
Re: pygobject
« Reply #3 on: January 20, 2013, 12:51:17 PM »
Thanks - it looks like that would fix the site-packages problem, but there's another one, apps compiling against python look for the headers in /tmp/tcloop/python-dev/usr/local/include...

Looks like the inelegent solution is the way to go  :(

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: pygobject
« Reply #4 on: January 20, 2013, 12:59:09 PM »
Use startup script to copy critical files from tar to ram. Did you check x86 version?
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14801
Re: pygobject
« Reply #5 on: January 20, 2013, 10:22:39 PM »
Yes and modified the extension to suit  :)

I was just looking for a better way to do it - will post after testing some more

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14801
Re: pygobject
« Reply #6 on: January 21, 2013, 01:22:35 AM »
posted