PyMaemo/FAQ

(New page: == What is Python? == Python is a dynamic object-oriented programming language that can be used for many kinds of software development. It offers strong support for integration with other...)
(links, <code>, <source>)
 
(5 intermediate revisions not shown)
Line 2: Line 2:
Python is a dynamic object-oriented programming language that can be used for many kinds of software development. It offers strong support for integration with other languages and tools, comes with extensive standard libraries, and can be learned in a few days.
Python is a dynamic object-oriented programming language that can be used for many kinds of software development. It offers strong support for integration with other languages and tools, comes with extensive standard libraries, and can be learned in a few days.
-
 
== What is PyMaemo? ==  
== What is PyMaemo? ==  
-
It is the Python package ported to run in Maemo based devices.
+
[[PyMaemo]] is the Python distribution for Nokia's Linux-based Maemo devices, providing a comprehensive set of platform bindings for rapid application development.
 +
 
 +
== What is Nokia's role in PyMaemo? ==
 +
Development and maintenance of PyMaemo is partially funded by Nokia. The project is community-supported and not part of the official [[Documentation/Maemo 5 Developer Guide/Development Environment/Maemo SDK|Maemo SDK]], providing us openness and flexibility of being able to continuously improve the packages using the maemo.org infrastructure instead of relying on the periodic SDK releases.
== Does PyMaemo come installed by default? ==
== Does PyMaemo come installed by default? ==
-
No, but there are some requirements and we expect to fulfill all of them in a near future.
+
No, but it is provided in the maemo.org Extras repository and gets installed as a dependency for many end-user applications.
 +
== Why are some modules (e.g.: curses) missing? ==
-
== Why to use two diferent .install files? ==
+
In order to keep the platform small and easy to support, PyMaemo only comes with the most commonly used packages.
-
Due to a limitation in Application Manager, only one repository can be handled by a .install file. PyMaemo depends on two repositories, to avoid duplication of packages. One repository contains base packages and another contains PyMaemo itself. This behaviour will change in a next release of Application Manager.
+
== Why do I get errors like “ImportError: No module named xyz” even though module xyz is installed under /usr/lib/python2.5 in Scratchbox? ==
-
Why I get "missing dependencies" message when I try to install PyMaemo?
+
-
Because you have to use both .install files (read previous question) as described at installation page.
+
Inside Scratchbox, if you call just “python” it will run the internal Python interpreter used by Scratchbox (/scratchbox/tools/bin/python), which is at the moment version 2.3. This interpreter will not see any modules installed inside your target.
 +
This occurs even if you use the complete path (/usr/bin/python), due to some path redirection trick done by Scratchbox. Therefore, to make sure you are using the correct Python interpreter in Scratchbox (currently at version 2.5), make sure to call “python2.5” explicitely, i.e. use “#!/usr/bin/python2.5 at the beginning of your scripts and modify Debian packaging so that python2.5 is called instead of just “python”.
-
== Why do some modules (e.g.: curses) are missing? ==
+
== When I build my Python application on Scratchbox, files are installed in /scratchbox/... How do I modify Debian packaging so the correct Python interpreter is called? ==
-
In order to keep the platform small and supportable, PyMaemo only comes with the most commonly used packages.
+
You can try adding these lines to the beginning of your <code>debian/rules</code> (after the first “#!/usr/bin/make -f” line):
 +
<source lang="make">
 +
PATH := /usr/bin:$(PATH)
 +
SBOX_REDIRECT_IGNORE := $(SBOX_REDIRECT_IGNORE):/usr/bin/python
 +
export PATH SBOX_REDIRECT_IGNORE
 +
</source>
-
== Why do I get the error <put some error message here>? ==
+
If that still does not work, please post your error messages to our mailing list.
-
First make sure that you are running python2.5 explicitly, as python inside scratchbox defaults to scratchbox' python (2.3)
+
[[Category:Python]]

Latest revision as of 12:41, 8 September 2010

Contents

[edit] What is Python?

Python is a dynamic object-oriented programming language that can be used for many kinds of software development. It offers strong support for integration with other languages and tools, comes with extensive standard libraries, and can be learned in a few days.

[edit] What is PyMaemo?

PyMaemo is the Python distribution for Nokia's Linux-based Maemo devices, providing a comprehensive set of platform bindings for rapid application development.

[edit] What is Nokia's role in PyMaemo?

Development and maintenance of PyMaemo is partially funded by Nokia. The project is community-supported and not part of the official Maemo SDK, providing us openness and flexibility of being able to continuously improve the packages using the maemo.org infrastructure instead of relying on the periodic SDK releases.

[edit] Does PyMaemo come installed by default?

No, but it is provided in the maemo.org Extras repository and gets installed as a dependency for many end-user applications.

[edit] Why are some modules (e.g.: curses) missing?

In order to keep the platform small and easy to support, PyMaemo only comes with the most commonly used packages.

[edit] Why do I get errors like “ImportError: No module named xyz” even though module xyz is installed under /usr/lib/python2.5 in Scratchbox?

Inside Scratchbox, if you call just “python” it will run the internal Python interpreter used by Scratchbox (/scratchbox/tools/bin/python), which is at the moment version 2.3. This interpreter will not see any modules installed inside your target.

This occurs even if you use the complete path (/usr/bin/python), due to some path redirection trick done by Scratchbox. Therefore, to make sure you are using the correct Python interpreter in Scratchbox (currently at version 2.5), make sure to call “python2.5” explicitely, i.e. use “#!/usr/bin/python2.5 at the beginning of your scripts and modify Debian packaging so that python2.5 is called instead of just “python”.

[edit] When I build my Python application on Scratchbox, files are installed in /scratchbox/... How do I modify Debian packaging so the correct Python interpreter is called?

You can try adding these lines to the beginning of your debian/rules (after the first “#!/usr/bin/make -f” line):

PATH := /usr/bin:$(PATH)
SBOX_REDIRECT_IGNORE := $(SBOX_REDIRECT_IGNORE):/usr/bin/python
export PATH SBOX_REDIRECT_IGNORE

If that still does not work, please post your error messages to our mailing list.