= Build and Installation = [[TracNav(Python_SIP/TOC)]] == Getting the Modules == #getting Currently we only distribute source codes and not binaries. The Python modules source codes along with some samples are included in PJSIP distribution, in [source:pjproject/trunk/pjsip-apps/src/python pjproject/pjsip-apps/src/python] directory. No separate download is needed. [[BR]] == Building The Modules From the Source == #build === Linux === ==== Requirements ==== 1. '''Python''': this normally should have been installed on every Linux. 1. '''Python development package''', to build the C extension. This might be called {{{python-devel}}} (e.g. on Fedora) or {{{python2.4-dev}}} (e.g. on Ubuntu). ==== Building the Module ==== Using Python build script: 1. Build the PJSIP libraries first with the usual "{{{./configure && make dep && make}}}" commands. 1. Go to {{{pjsip-apps/src/python}}} directory. 1. Run '''{{{'sudo python ./setup.py install'}}}''' or just '''{{{'sudo make'}}}''' Sample session: {{{ #!sh $ cd your-pjsip-root-dir $ ./configure && make dep && make $ cd pjsip-apps/src/python $ sudo make }}} === Microsoft Windows === ==== Requirements ==== 1. '''Python SDK''': I personally use [ftp://ftp.activestate.com/ActivePython/windows/2.4/ ActivePython-2.4.3-12] distribution from [http://www.activestate.com ActiveState], since it has a matching debug package. 1. '''Visual Studio''': for building the C extension. 1. '''Optional: debug package''': the debug package is useful if you want to debug the C extension. You can download it from ftp://ftp.activestate.com/ActivePython/etc/ ==== Building the Module with Visual Studio ==== '''Step 1: Building the C Extension''': 1. Open '''pjsip-apps.dsw''' from {{{pjsip-apps\build}}} directory. 1. Select '''python_pjsua''' project as the active project. 1. Build the project 1. The {{{_pjsua.pyd}}} Python module will be placed in {{{pjsip-apps\lib}}} directory. '''Step 2: Installing the Modules''': 1. Open ''Command Prompt'' 1. Go to '''{{{pjsip-apps\src\python}}}''' directory 1. Run '''{{{python setup-vc.py install}}}''' (note that the installation script is {{{setup-vc.py}}} and not {{{setup.py}}}). Sample session: {{{ C:> cd your-pjsip-root-directory C:> cd pjsip-apps\src\python C:> python setup-vc.py install }}} ==== Building the Module with MinGW ==== Adamczak Krzysztof suggested this on PJSIP mailing list to build the extensions with MinGW: {{{ python setup.py build_ext --compiler=mingw32 install }}} === Common Problems === ==== Cannot open include file: 'Python.h' ==== You need to install Python SDK.