Reply
Thread Tools
BrentDC's Avatar
Posts: 903 | Thanked: 632 times | Joined on Apr 2008
#1
I've been trying to get Python working in scratchbox, but so far have been unsuccessful. Take a look:

Code:
[sbox-DIABLO_X86: ~] > fakeroot apt-get install python2.5-sdk
Reading package lists... Done
Building dependency tree... Done
python2.5-sdk is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
[sbox-DIABLO_X86: ~] > python
Python 2.3.4 (#1, Sep 26 2008, 16:50:43)
[GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gtk
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: No module named gtk
Does anyone know what the problem may be? Thanks.
__________________
-Brent

Author of TouchSearch -- web searching software for Maemo 5.

Mobile Device lineage: Palm Z22 -> Palm TX -> Nokia N800 -> Nokia N900
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#2
Invoke python 2.5 directly by running "python2.5".
 

The Following User Says Thank You to qwerty12 For This Useful Post:
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#3
Yeah, this is where I punted.

The pygtk stuff is usually in:

/usr/lib/python2.5/site-packages

but I think in sb it's hangin' out in:

/usr/lib/python-packages

The README file in the above directory suggests reading this file for more info:

/usr/lib/python2.5/site.py

Sorry I'm so lazy. Did qwerty12 fix it for you?
__________________
N9: Go white or go home
 

The Following User Says Thank You to daperl For This Useful Post:
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#4
Oh yeah, I think I made a symlink inside /usr/bin

python -> python2.5

I don't think it helped me though.

Firing my box up now...

EDIT:

Did you do the following?

fakeroot apt-get install python2.5
fakeroot apt-get install python-gtk2

And things are working except for hildon. There doesn't seem to be hildon python bindings in the repositories that the Beta SDK is pointing to.
__________________
N9: Go white or go home

Last edited by daperl; 2009-05-26 at 16:13.
 
BrentDC's Avatar
Posts: 903 | Thanked: 632 times | Joined on Apr 2008
#5
Using python2.5 directly allows me to import gtk, hildon, etc. Thanks! One other issue, though, is when I try to open an application in Xephyr (python2.5 test.py), nothing appears but no errors are given either.

Hmm...

Edit: This reminds me, I hate scratchbox.
__________________
-Brent

Author of TouchSearch -- web searching software for Maemo 5.

Mobile Device lineage: Palm Z22 -> Palm TX -> Nokia N800 -> Nokia N900

Last edited by BrentDC; 2009-05-26 at 16:02.
 
BrentDC's Avatar
Posts: 903 | Thanked: 632 times | Joined on Apr 2008
#6
A picture says a thousand words;

__________________
-Brent

Author of TouchSearch -- web searching software for Maemo 5.

Mobile Device lineage: Palm Z22 -> Palm TX -> Nokia N800 -> Nokia N900
 
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#7
Hey, how did you get hildon working?
__________________
N9: Go white or go home
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#8
Originally Posted by daperl View Post
Oh yeah, I think I made a symlink inside /usr/bin

python -> python2.5

I don't think it helped me though.

Firing my box up now...
That's because scratchbox intercepts it and runs its own, old, native version of python (as BrentDC saw). If you really want to make running "python" run python2.5 do this:

Code:
export SBOX_REDIRECT_IGNORE=/usr/bin/python ; export PATH=/usr/bin:$PATH
But at the cost of having a slow shell in scratchbox...

Originally Posted by daperl View Post
Hey, how did you get hildon working?
His terminal is self-explanatory :P
 
BrentDC's Avatar
Posts: 903 | Thanked: 632 times | Joined on Apr 2008
#9
Originally Posted by daperl View Post
Hey, how did you get hildon working?
I followed exactly what Qwerty said I don't know if it is really *working* though, I still can't get apps to run.
__________________
-Brent

Author of TouchSearch -- web searching software for Maemo 5.

Mobile Device lineage: Palm Z22 -> Palm TX -> Nokia N800 -> Nokia N900
 
thp's Avatar
Posts: 1,390 | Thanked: 4,262 times | Joined on Sep 2007 @ Vienna, Austria
#10
Originally Posted by BrentDC View Post
One other issue, though, is when I try to open an application in Xephyr (python2.5 test.py), nothing appears but no errors are given either.
After having done "export DISPLAY=:2" (or wherever your Xephyr sits) and "af-sb-init.sh start" (which should bring up the Desktop in Xephyr), run your app from the commandline with "run-standalone.sh" prefixed, i.e.

Code:
export DISPLAY=:2
af-sb-init.sh start
run-standalone.sh python2.5 test.py
(of course, you only do the first two commands once whenever you enter scratchbox)
 

The Following 2 Users Say Thank You to thp For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 12:01.