[Distutils] Re: SWIG: two modules, but only one can be installed

Torsten Bronger bronger at physik.rwth-aachen.de
Mon Feb 21 00:26:28 CET 2005


Hallöchen!

Lars Immisch <lars at ibp.de> writes:

>> I have a module here that makes a library available to python using
>> SWIG.  The setup.py file looks like this:
>> setup(name = 'my',
>>       py_modules = ['mymodule','my'],
>>       ext_modules = [Extension('_mymodule',
>>                                sources = ['mymodule.c',
>>                                           'mymodule.i'])]
>> )
>> Unfortunately, SWIG creates not only "_mymodule" but also
>> "mymodule".  However, the above script must be called twice, because
>> at the first run, "mymodule" doesn't exist yet.  (This is
>> accompanied by error messages, by the way.)
>
> [...]
>
> Briefly, off the top of my head:
>
> include all code that you used to have in mymodule.py in a
>
> %pythoncode %{
> %}
>
> section in mymodule.i.

But mymodule.py doesn't exist as a source file.  Instead, it is
*created* by SWIG.

Tschö,
Torsten.

-- 
Torsten Bronger, aquisgrana, europa vetus



More information about the Distutils-SIG mailing list