maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   D-Bus error: Not enough memory?? Weird compiling python error. (https://talk.maemo.org/showthread.php?t=37423)

HangLoose 2009-12-16 15:22

D-Bus error: Not enough memory?? Weird compiling python error.
 
I am following this tutorial:
http://wiki.maemo.org/PyMaemo/UsingPythonInMaemo

When I try to compile this code:
Code:

#!/usr/bin/env python2.5
import gtk
import hildon
 
class HelloWorldApp(hildon.Program):
  def __init__(self):
    hildon.Program.__init__(self)
 
    self.window = hildon.Window()
    self.window.connect("destroy", gtk.main_quit)
    self.add_window(self.window)
 
    label = gtk.Label("Hello World!")
    self.window.add(label)
    label.show()
 
  def run(self):
    self.window.show_all()
    gtk.main()
 
app = HelloWorldApp()
app.run()

I get the following error:
Quote:

[sbox-FREMANTLE_X86: /usr/lib/hildon-desktop] > python2.5 hello_world_home.py
process 28672: arguments to dbus_connection_get_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5757.
This is normally a bug in some application using the D-Bus library.
process 28672: arguments to dbus_connection_set_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5721.
This is normally a bug in some application using the D-Bus library.
python2.5[28672]: GLIB ERROR ** default - Not enough memory to set up DBusConnection for use with GLib
aborting...
Aborted (core dumped)
Any idea what that means?

bodell 2009-12-16 15:51

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Try putting a "run-standalone.sh" before python2.5 in your command line.

I would recommend against that tutorial, it is out of date. Start here: http://wiki.maemo.org/PyMaemo
Then go here: http://wiki.maemo.org/PyMaemo/UITutorial

krk969 2010-01-03 14:28

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
I did the above and also ran the below commands as per the wiki in my ARMEL target

X86: ~] > eval $(dbus-launch --sh-syntax)
X86: ~] > export BUS_SESSION_BUS_ADDRESS
X86: ~] > export DBUS_SESSION_BUS_PID

corrected a typo in the wiki
export BUS_SESSION_BUS_ADDRESS
should be
export DBUS_SESSION_BUS_ADDRESS
I think.

Anyways I still get this error

could you help ?

[sbox-FREMANTLE_ARMEL: ~] > run-standalone.sh python2.5 py.py
process 24390: arguments to dbus_connection_get_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5757.
This is normally a bug in some application using the D-Bus library.
process 24390: arguments to dbus_connection_set_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5721.
This is normally a bug in some application using the D-Bus library.
python2.5[24390]: GLIB ERROR ** default - Not enough memory to set up DBusConnection for use with GLib
aborting...
qemu: uncaught target signal 6 (Aborted) - core dumped
[sbox-FREMANTLE_ARMEL: ~] > cat py.py
import gtk
import hildon
[sbox-FREMANTLE_ARMEL: ~] >

qwerty12 2010-01-03 14:38

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Maybe this'll work, I don't know:

Switch to the X86 target, fire up Xephyr as per the Wiki instructions, run af-sb-init.sh start, don't start up D-Bus manually, and, finally, run-standalone.sh python2.5 py.py

krk969 2010-01-03 15:02

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Quote:

Originally Posted by qwerty12 (Post 451185)
Maybe this'll work, I don't know:

Switch to the X86 target, fire up Xephyr as per the Wiki instructions, run af-sb-init.sh start, don't start up D-Bus manually, and, finally, run-standalone.sh python2.5 py.py

thanks qwerty12, but the hildon python bindings seem to be available for ARM only as of now.

In anycase, does that mean I cannot use hildon bindings in python on the ARMEL target ?

thp 2010-01-03 15:22

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Quote:

Originally Posted by krk969 (Post 451220)
thanks qwerty12, but the hildon python bindings seem to be available for ARM only as of now.

In anycase, does that mean I cannot use hildon bindings in python on the ARMEL target ?

The hildon python bindings are available for X86 as well, you just have to install them separately for the X86 "target" (btw, you have to do this for all packages that you need in both targets). A "fakeroot apt-get install python2.5-hildon" in the X86 target should do the trick.

krk969 2010-01-03 15:37

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Quote:

Originally Posted by thp (Post 451234)
The hildon python bindings are available for X86 as well, you just have to install them separately for the X86 "target" (btw, you have to do this for all packages that you need in both targets). A "fakeroot apt-get install python2.5-hildon" in the X86 target should do the trick.

Thanks thp.

I tried that in the X86 target , but hadnt worked coz maybe the repositories werent there in my apt/source.list.

But it had worked for ARMEL target and I could download with the same list of repositories.

this is my /etc/apt/sources.list

deb http://repository.maemo.org/ fremantle/sdk free non-free
deb-src http://repository.maemo.org/ fremantle/sdk free
deb http://repository.maemo.org/ fremantle/tools free non-free
deb-src http://repository.maemo.org/ fremantle/tools free


But my main intention is to develop for ARMEL and I keep getting the above error.

EDIT::
added the extras-devel repository to get this result

[sbox-FREMANTLE_X86: ~] > fakeroot apt-cache search python2.5-hildon
python-hildon - Python bindings for Hildon Framework.
python-hildondesktop - Python bindings for libhildondesktop

krk969 2010-01-03 15:49

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
same error in X86 target also

[sbox-FREMANTLE_X86: ~] > run-standalone.sh ./py.py
process 27248: arguments to dbus_connection_get_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5757.
This is normally a bug in some application using the D-Bus library.
process 27248: arguments to dbus_connection_set_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5721.
This is normally a bug in some application using the D-Bus library.
python2.5[27248]: GLIB ERROR ** default - Not enough memory to set up DBusConnection for use with GLib
aborting...
/usr/bin/run-standalone.sh: line 11: 27248 Aborted (core dumped) "$@"

thp 2010-01-03 15:52

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Yes, install "python-hildon" then.. my fault (it was called python2.5-hildon some time ago). As Python is a scripting language, and you don't compile python scripts in the traditional sense (the Python interpreter does compile the source file into Python bytecode - *.pyc and *.pyo files - but these are platform-independent).

I'm also developing Python applications for the N900, and do all my testing in the SDK with the X86 target. I also do lots of testing directly on-device, as I just need to rsync my source tree to the device and test it using SSH or the X Terminal - no compiling needed :)

In short: Unless you are writing Python C extension modules, you should not need to care about the ARMEL target, and the X86 target will give you less headache. Do a "fakeroot apt-get install python-hildon" in Scratchbox, and don't forget to always call Python with "python2.5", as "python" will most likely use the Scratchbox-provided python 2.3.

thp 2010-01-03 15:54

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Quote:

Originally Posted by krk969 (Post 451279)
same error in X86 target also

[sbox-FREMANTLE_X86: ~] > run-standalone.sh ./py.py
process 27248: arguments to dbus_connection_get_data() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 5757.

You have started Xephyr, did an "export DISPLAY=:2" and ran "af-sb-init.sh start" and after that (in the same session) did the "run-standalone.sh python2.5 py.py"? Maybe your installation is simply broken. You can try copying the file to your device and trying it out there (you might need to install the necessary packages on the device or simply install an app that drags in the required dependencies).

krk969 2010-01-03 16:02

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Quote:

Originally Posted by thp (Post 451287)
You have started Xephyr, did an "export DISPLAY=:2" and ran "af-sb-init.sh start" and after that (in the same session) did the "run-standalone.sh python2.5 py.py"? Maybe your installation is simply broken. You can try copying the file to your device and trying it out there (you might need to install the necessary packages on the device or simply install an app that drags in the required dependencies).

yes worked.
had to start the hildon desktop using af-sb-init.sh

thanks thp.

So, until we can start the hildon destop in ARMEL maybe we cant use hildon python bindings in ARMEL ?
maybe thats the issue :confused:

i really want to be able to use it there for my purpose lies in ARMEL :(

danielwilms 2010-01-04 09:02

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Quote:

Originally Posted by krk969 (Post 451297)
So, until we can start the hildon destop in ARMEL maybe we cant use hildon python bindings in ARMEL ?
maybe thats the issue :confused:

i really want to be able to use it there for my purpose lies in ARMEL :(

The ARMEL target is just there for cross-compiling and not to test or run applications. Therefore please use the X86 target. As you don't have to cross-compile with python there is no need for the ARMEL target in your case. And always specify the python version you want to run it with like:

Code:

run-standalone.sh python2.5 <script.py>
otherwise it might happen that you start it with python 2.3.

Daniel

krk969 2010-01-04 10:47

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Quote:

Originally Posted by danielwilms (Post 452238)
The ARMEL target is just there for cross-compiling and not to test or run applications. Therefore please use the X86 target. As you don't have to cross-compile with python there is no need for the ARMEL target in your case. And always specify the python version you want to run it with like:

Code:

run-standalone.sh python2.5 <script.py>
otherwise it might happen that you start it with python 2.3.

Daniel

thanks , but , yes have done exactly that

danielwilms 2010-01-04 10:51

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Quote:

Originally Posted by krk969 (Post 452326)
thanks , but , yes have done exactly that

Yes but in the ARMEL target. As I said, it is not meant to run applications. Just the X86 target.

Daniel

krk969 2010-01-04 10:57

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
thanks Daniel.

do you think it would run on the N900 itself ?

Im keen to use the python-hildon bindings to test it on the N900 , as I have extensions compiled in ARM that I would like to use, is this possible ? any chance you have tried using the hildon bindings on maemo ?

danielwilms 2010-01-04 15:01

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Quote:

Originally Posted by krk969 (Post 452334)
thanks Daniel.

do you think it would run on the N900 itself ?

Im keen to use the python-hildon bindings to test it on the N900 , as I have extensions compiled in ARM that I would like to use, is this possible ? any chance you have tried using the hildon bindings on maemo ?

Which extensions have you compiled? Have you created them? Are they available somewhere? what is exactly your setup?

Daniel

krk969 2010-01-04 15:21

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Quote:

Originally Posted by danielwilms (Post 452573)
Which extensions have you compiled? Have you created them? Are they available somewhere? what is exactly your setup?

Daniel

I havent yet created the extensions for my lib. (qtsysteminfo present in extras-devel )
Was going through some swig documentation for the same.

Anyways my intention was to use python scripts to create apps based on QT mobility api's.
Ive tried the apps using c++ without hildonizing.
For a start I wanted to write a python script to call an existing app Ive created batlevel_1.0-3 ( extras-devel ) which uses qtsysteminfo.
All this is currently compiled in ARM so I will need to make extensions for them to use them in my python script.

Hope this is the right direction.

thanks

lizardo 2010-01-04 17:14

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
@krk969:

To test your Python applications, you have two options: either you test them on the X86 target, or you test on the N900 directly. Testing on the ARMEL target will almost always not work.

Now you said your application has a custom extension, is that right? If those are real (*.so) extensions (written in C) and not just plain Python modules (*.py), you have to compile them on the x86 target to be able to test them on your desktop. Otherwise you should only compile them on the ARMEL target, install the generated packages on the N900 and test them there.

nux 2010-01-08 13:39

Re: D-Bus error: Not enough memory?? Weird compiling python error.
 
Is it possible to package python application without scratchbox.
I have a python program in one py file.
It run's just fine in N900 via command "python filename.py"

But if I want to pacage it for uploading to garage it gave me an error.
See this thread: http://talk.maemo.org/showthread.php?p=458283


All times are GMT. The time now is 10:45.

vBulletin® Version 3.8.8