OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

2 Pages V   1 2 >  
Reply to this topicStart new topic
> Python Support, python related questions on pdaXrom
bubak
post Apr 22 2006, 12:55 AM
Post #1





Group: Members
Posts: 13
Joined: 14-April 06
From: Czech Republic
Member No.: 9,619



First, a few notes:

1. i started this topic as a general place to discuss anything related to python on pdaXrom
2. i hope this topic will stay clear enough to serve as a knowledge-base
3. if you think this is a good idea, please:

a) use keywords in your posts, i recommend:

package <python_stdlib_package name> if it concernes some std lib package

error <short_description> if you encounter an error and you want to help solving it (think over if there is not a better place to ask (such as python mailing list)

error importing <package> if you encounter an error with package import thta should be working

i believe you can think up your own reasonable keywords

b) keep it simple and threaded -- problems with forums is, that it contains the info you need, but it is hard to find them (that's why the keywords :)

thanks.
Go to the top of the page
 
+Quote Post
bubak
post Apr 22 2006, 01:05 AM
Post #2





Group: Members
Posts: 13
Joined: 14-April 06
From: Czech Republic
Member No.: 9,619



error importing pygtk

2006-04-22, 1.1.0beta3

this error shows up if you used to import the pygtk the way it is supposed for example in pyGtk tutorial:

CODE
import pygtk
pygtk.require("2.0")
import gtk


the solution i experienced is to import only the gtk module

CODE
#import pygtk
#pygtk.require("2.0")
import gtk


in such a case all the gtk objects are still directly available and you can use them.
Go to the top of the page
 
+Quote Post
bubak
post Apr 22 2006, 01:13 AM
Post #3





Group: Members
Posts: 13
Joined: 14-April 06
From: Czech Republic
Member No.: 9,619



error importing threading

2006-04-22, 1.1.0beta3

i encountered an error importing threading module after succesfull installation

it complains about importing a non-existent 'collections' module in "/usr/lib/python2.4/threading.py" line 13

collections module is new in python 2.4 and is not available as an ipk package as of the date of this post (see above)

you can probably solve this by copying the module from your desktop distro to the zaurus, thouhg i didnt try (i use python 2.3 still)

so i ask the developers of the python pdaXrom packages to enable that module in ipk feed
Go to the top of the page
 
+Quote Post
bubak
post Apr 22 2006, 01:31 AM
Post #4





Group: Members
Posts: 13
Joined: 14-April 06
From: Czech Republic
Member No.: 9,619



tip: emacs & python-mode

2006-04-22, 1.1.0beta3

installing emacs with python support (ie. python-mode) on pdaXrom is easy and takes only these steps:

1. install emacs, best way is to use packages provided by pgas, see feed:

Pgas feed

(i have to download them by hand and install manually with ipkg command: ipkg -d /home/user install <ipg_package>)

2. download the python-mode distribution from surceforge

python-mode from sf.net download

(just grap the latest version)

3. unpack somewhere, i use ~/.emacs.d/site-lisp for packages i maintain locally

4. load the module in a standard way to your emacs (part of .emacs):

CODE
;; include the location of python-mode.el to your load path
(add-to-list 'load-path "~/.emacs.d/site-lisp")
;; load it
(load "python-mode")
;; associate the file extension with the desired mode
(setq auto-mode-alist (append '(("\\.py$" . python-mode)) auto-mode-alist))
(setq auto-mode-alist (append '(("\\.jy$" . python-mode)) auto-mode-alist))
(setq auto-mode-alist (append '(("\\.psp$" . python-mode)) auto-mode-alist))
Go to the top of the page
 
+Quote Post
fabianE
post Apr 22 2006, 02:18 PM
Post #5





Group: Members
Posts: 60
Joined: 13-December 03
From: Germany
Member No.: 1,173



tip: ipython and easy_install

ipython is an interactive python shell with autocomplete and more (http://ipython.scipy.org/)

requirements are installed readline

1. install easy-install first from http://peak.telecommunity.com/DevCenter/EasyInstall
2. install ipython: easy_install ipython
Go to the top of the page
 
+Quote Post
bubak
post Apr 30 2006, 02:48 AM
Post #6





Group: Members
Posts: 13
Joined: 14-April 06
From: Czech Republic
Member No.: 9,619



QUOTE(bubak @ Apr 22 2006, 11:13 AM)
error importing threading


2006-04-30

this problem can be solved by unistalling the python-core ipkg and installing the python, which includes all the standard packages for python distribution

remember to always isntall at least one python interpreter (ie. python-core or python) with gtk support (pygtk ipkg) because several gui application are using it (cpuoverclock.py, ...)

some notes:

1. python ipkg itself requires more than cca 16M of free space, the download size is cca 5M

2. there are problems when installing python and than pygtk -- the pygtk depends on python-core instead of python or python-core, so installing pygtk installs also python-core and dependencies, which results in ovewriting some of python files (well, the overwriting does not really matter -- the python is superset of python-core, but it leaves things in somewhat strange state)

3. my recommandation is just to install python and than by hand install pygtk -- pygtk actually installs only modules (files) under <root>/usr/lib/python2.4/site-packages; is is perfectly safe to extract the files there
Go to the top of the page
 
+Quote Post
bubak
post Apr 30 2006, 02:52 AM
Post #7





Group: Members
Posts: 13
Joined: 14-April 06
From: Czech Republic
Member No.: 9,619



QUOTE(fabianE @ Apr 23 2006, 12:18 AM)
tip: ipython and easy_install


2006-04-30

easy-install requires full python installation, so replace python-core with full sized python, see my other post on "error importing threading" how to achieve this
Go to the top of the page
 
+Quote Post
fabianE
post Apr 30 2006, 03:20 AM
Post #8





Group: Members
Posts: 60
Joined: 13-December 03
From: Germany
Member No.: 1,173



QUOTE
easy-install requires full python installation, so replace python-core with full sized python, see my other post on "error importing threading" how to achieve this
*


That's interesting, I didn't notice that we have two version from python to choose from. What about python development headers, are there also available? Some python-eggs like RuleDispatch need them to compile...

Regards,

Fabian
Go to the top of the page
 
+Quote Post
anunakin
post May 3 2006, 04:14 AM
Post #9





Group: Members
Posts: 340
Joined: 22-August 04
From: Belem, Brasil
Member No.: 4,358



I need know whats packages have this modules for python:
CODE
Numeric
fnmatch
glob  
pickle
pickletools

huh.gif
Go to the top of the page
 
+Quote Post
bubak
post May 13 2006, 07:12 AM
Post #10





Group: Members
Posts: 13
Joined: 14-April 06
From: Czech Republic
Member No.: 9,619



QUOTE(anunakin @ May 3 2006, 02:14 PM)
CODE
Numeric
fnmatch
glob  
pickle
pickletools


1. fnmatch, glob, pickle, pickletools => use python2.4 (you should remove the 'python-*' (even the python-core) and install just pure python 2.4.1) ... this is complete installation f python 2.44 indluding all the stdlib packages (codecs, dbus, xml, ...)

you should also install pygtk to enable some gui system tools. unfortunately enough pygtk depends on python-core (that should be removed by now) so do not install the dependencies for it (you aready have them)

2. Numeric => extension of python, usually called 'numeric python', not part of the stdlib (dont know where to get those, you should probably compile them, you may also try easy_install Numeric, if you use easy_install)
Go to the top of the page
 
+Quote Post
desertrat
post May 13 2006, 11:30 AM
Post #11





Group: Members
Posts: 742
Joined: 15-October 05
From: Gulag, Siberia
Member No.: 8,322



QUOTE(bubak @ May 13 2006, 03:12 PM)
2. Numeric => extension of python, usually called 'numeric python', not part of the stdlib (dont know where to get those, you should probably compile them, you may also try easy_install Numeric, if you use easy_install)

Anunakin has already compiled Numeric himself smile.gif

http://mail.pdaxrom.org/contrib/anunakin/

-- cheers
Go to the top of the page
 
+Quote Post
flyvholm
post Jun 15 2006, 09:29 PM
Post #12





Group: Members
Posts: 12
Joined: 25-May 06
From: Fairbanks, Alaska
Member No.: 9,966



Installing any Python module on pdaXrom

A Python ignoramus wants to run a Python application (in my case DCD for telescope control) that requires some modules not found in the standard install. What is the way to go about finding and installing the required modules? Do you have to find an ipk that is specific to pdaXrom and the Python version? Can you use the .py-files in the cross compiler environment library and if so, how? I don't know what "installing a python module" actually means...
Go to the top of the page
 
+Quote Post
clofland
post Jun 16 2006, 05:28 AM
Post #13





Group: Members
Posts: 245
Joined: 30-October 03
Member No.: 813



Actually, in most cases, you can just copy the python files into your Z from any machine (even Windows!) if they are just python files. On your Z look in /usr/lib/python2.* and you will see lots of directories and python files. Look on your machine where the app is working in python's lib directory. Find the one you think it needs and copy it over.

You won't break anything that way as long as you just add files (not overwrite them).

The "modules" are just python code, and that is the beauty of python, code that runs on ANY platform!
Go to the top of the page
 
+Quote Post
flyvholm
post Jun 17 2006, 01:29 AM
Post #14





Group: Members
Posts: 12
Joined: 25-May 06
From: Fairbanks, Alaska
Member No.: 9,966



Thanks clofland, sounds good.

To spell out what to do (according to what I found on the web, correct me if wrong):
Find the .pyc files for the modules asked for (on your laptop or on the web, they're platform independent so can be used as is) and copy them to the /usr/lib/python2.* folder on your Zaurus. If you're finding .py files rather than .pyc files, you can generate the .pyc files by compiling the .py files with e.g. "python compileall.py" from a shell prompt.

Well, I'm still stuck. I need the module zlib.py which isn't in the python libraries on my laptop (but test_zlib.py is!?! What is that about?). Found it online, but the very first line in it reads:
from java import util, lang
which generates the error "No module named java". Now the couple of java.py files I have managed to find are different and have no "util" or "lang" in them, so I suspect there is no default java.py module. What is the problem I need to fix here?
Go to the top of the page
 
+Quote Post
maystorm
post Jul 31 2006, 11:38 AM
Post #15





Group: Members
Posts: 48
Joined: 15-June 05
From: Hamburg, Germany
Member No.: 7,357



On my C3000 with 1.1.0beta1, I'm trying to run PySol which provides tons of Solitaire-like games. The Python interpreter claimed about a number of missing modules which I copied from my desktop Linux box and their error messages went away.

However, now it claims that "TKinter" is missing. I couldn't find any module with that name. As far as I figured out "TKinter" has something to do with Tcl/Tk and needs somewhat compiled directly into the Python interpreter.

Q: Has somebody tried to compile Python for pdaXrom with "TKinter" support included?
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 28th December 2014 - 12:06 AM