Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Archived:Build PySymbian

From Wiki
Jump to: navigation, search

Archived.pngAquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.

Article Metadata
Created: rcu (19 Dec 2010)
Last edited: hamishwillee (31 May 2013)

This article shows how to build the PySymbian 2.0 runtime and extensions from source.

Needs-update.pngThis article needs to be updated: If you found this article useful, please fix the problems below then delete the {{ArticleNeedsUpdate}} template from the article to remove this warning.

Reasons: hamishwillee (14 Nov 2011)
Compiler required to build no longer available (was linked at http URL (// It also doesn't explain where the source can be obtained.

Steps to build PySymbian 2.0:

Note: to build PySymbian 2.0 I got inspired from\src\README_BUILD_INSTRUCTIONS.txt.

To build we need:

To configure the build, open a command prompt:

  • give: set EPOCROOT=\
  • give: subst t: C:\Symbian\9.1\S60_3rd_MR (for example)
  • (make sure that Python 2.5.4 is in your PATH.)
  • unzip in T:\PySymbian_2_0
  • give: T: and then cd PySymbian_2_0
  • give: python configure -s 30gcce -k selfsigned --caps "LocalServices NetworkServices ReadUserData WriteUserData UserEnvironment" >stdout_config

(Note: I was not able to successfully run python build --device because the GCCE compiler crashes (:o) at _sre.c - somebody else had the same issue: . Therefore I use Carbide directly.)

To build:

  • open Carbide:
  • import in Carbide C:\Symbian\9.1\S60_3rd_MR\PySymbian_2_0\newcore\Symbian\group\bld.inf. (do not import T:\...\bld.inf, since Carbide and the project need to reside on the same drive, otherwise you receive errors).
  • build GCCE release.

Then I have C:\Symbian\9.1\S60_3rd_MR\Epoc32\BUILD\Symbian\9.1\S60_3rd_MR\PySymbian_2_0\newcore\Symbian\group\PYTHON25\GCCE\UREL\python25.dll. :))) But a few modules didn't compile :(.

Notes about ARMV5 and GCCE build configurations:

Building PyS0 extensions


  • Install S60 SDK – tried with 3rd edition FP1.
  • Install Carbide (tested on 2.7 and 2.3).
  • Install PySymbian 2.0 SDK and copy the header files, etc in Symbian\9.2\S60_3rd_FP1, etc!!!!.


  • At least for S60 3rd FP1 edit C:\Symbian\9.2\S60_3rd_FP1\Epoc32\include\python25\pyconfig.h:
     commented (not necessary in amigaconfig.h)
     #define HAVE_STDINT_H 1
     #define HAVE_UINTPTR_T 1
     #define HAVE_SYS_SELECT_H 1
     #define HAVE_WCHAR_H 1
     uncommented (probably not necessary) /* #undef HAVE_USABLE_WCHAR_T */
     added also in the automatically generated .mmp by Py_XT_create - SYSTEMINCLUDE \epoc32\include\libc 
     edited /Symbian/9.2/S60_3rd_FP1/EPOC32/include/python25/Python-ast.h - add newline at EOF
  • Also, to build sysagent module on 3rd edition FP1
       Copied SharedData\epoc32\include\psvariables.h, coreapplicationuisinternalpskeys.h and telephonyinternalpskeys.h from
       (note that it is MR and not FP1)

In Carbide:

  • import project - Symbian OS\Symbian OS Bld.inf file
  • import bld.inf in Carbide - select All Build config
  • Build Configuration\Set Active - Phone Release (GCCE)
  • put the project on the same drive as the Carbide installation
  • then build project
  • then find generated .pyd in C:\Symbian\9.2\S60_3rd_FP1\Epoc32\release\gcce\urel\

If converting PySymbian 1.4.5 extensions to PySymbian 2.0 consult PySymbian manual. Reproduced here: The changes needed for porting existing native PySymbian extensions are as follows:

  • From Symbian 9.1 onwards Symbian allows Writable Static Data in a DLL by making use of EPOCALLOWDLLDATA keyword in the mmp file. Main reason for this one is for porting some non-Symbian applications onto Symbian. Thus TLS functionality is no longer needed. Use EPOCALLOWDLLDATA in the MMP file if the module has initialized static data.
  • Use PyGILState_Ensure() and PyGILState_Release() functions for acquiring and releasing the global interpreter lock, instead of using PyEval_RestoreThread(PYTHON_TLS->thread_state) and PyEval_SaveThread().
  • The interpreter DLL name is changed to python25.lib. This change has to be reflected in the MMP file so that the module is linked against this DLL instead of python222.lib used in 1.4.x.
  • The Python header files are now in \epoc32\include\Python25 and hence the MMP file needs to be updated accordingly.
  • The pyd name should be kf_module-name.pyd.
   Note: This change is required only for the pyd name and module name is not required to have this prefix.
  • Packaging an extension module is explained in section 8.1.3, Distributing extension modules.
   Note: The init-function still needs to be exported in the pyd at ordinal 1.


   Be careful to choose the Carbide project name the same as the folder name, otherwise it will give error at import.
   While importing project, be sure also to choose the right workspace path (e.g., the folder containing group, src, inc of each project).

Py_XT_Creator - movie on YouTube says:

  • enter name, UID
  • import bld.inf in Carbide - select All Build config
  • Build Configuration\Set Active - Phone Release (GCCE)
  • Go to Project Properties\SIS builder tab, give Add, choose PKG File the one sis\....pkg
This page was last modified on 31 May 2013, at 01:06.
102 page views in the last 30 days.