From: omnia neo on
On Apr 9, 7:41 pm, Gabriel Genellina <gagsl-...(a)yahoo.com.ar> wrote:
> omnia neo <neo.omnia7 <at> gmail.com> writes:
>
>
>
>
>
> > On Apr 9, 10:42 am, omnia neo <neo.omn...(a)gmail.com> wrote:
> > > On Apr 9, 10:30 am, Stefan Behnel <stefan...(a)behnel.de> wrote:
>
> > > > omnia neo, 09.04.2010 07:01:
>
> > > > > import siptest
>
> > > > > I get following error :
> > > > > import error : no module named siptest
>
> > > > Is the directory where your siptest.dll lies in your PYTHONPATH
> (sys.path)?
> > > well I added PYTHONPATH = <my dll path> in my environment variables
> > > (windows XP).
>
> > well I just tried this too.
> > I added the path using sys.path on the fly in my python script as
> > follows:
>
> > ###############
> > import sys
> > sys.path.append("<dll path>")
> > print sys.path
> > import siptest
> > ###############
>
> > again same error:
> > ImportError: No module named siptest.
>
> Make sure the extension module must is called siptest.pyd, not siptest.dllhttp://docs.python.org/extending/windows.html
> (I'd expect SIP to take care of this)
>
> --
> Gabriel Genellina- Hide quoted text -
>
> - Show quoted text -

SIP tool installation steps are as follows:
• Download latest SIP from: http://www.riverbankcomputing.co.uk/software/sip/download
and unzip to any location.
• Make sure python is in PATH of environment variables -> PATH = %PATH
%;C:\python26
• Go to cmd promt -> go to the SIP location (location of download) ->
run :/python configure.py
• It will take all the default setting for configuration, the default
directories will be in c:\python26 (change if required)
• Go to Start -> programs -> MS visual studios -> visuals studio tools-
> command prompt. Go to SIP folder (location of download)
• \> nmake -> this will run makefile and build sip.exe and sip.pyd
• \> nmake install -> this will copy: sip.exe, sip.pyd,sip.h,
sipconfig.py, sipdistutils.py in C:\python26 <default locations>
• Go to the folder where the manually written .sip file is present in
command prompt and run the following:
sip -e -j 1 -c . xyz.sip

Steps to create an extension module:
1. Create a “.sip” specification file for the C/C++ library
a. Follow the syntax definitions as given in
http://www.riverbankcomputing.co.uk/static/Docs/sip4/specification_files.html#syntax-definition
b. Appropriately add the C/C++ classes, functions, methods and
structures in the specification file.
2. Run the SIP tool utility on the specification file to create the
intermediate C/C++ code.
3. Copy and edit the simple build script as shown in
http://www.riverbankcomputing.co.uk/static/Docs/sip4/using.html#a-simple-c-example
4. Run the build script to create the makefile, the CModule, the .sbf
files
5. Run Visual Studios nmake utility on the makefile to create the .pyd
file which is the final module which can be imported from python.