win32 pyserial requires javax.comm for py2exe?

Chris Liechti cliechti at gmx.net
Tue Jun 29 18:06:27 EDT 2004


Thomas Heller <theller at python.net> wrote in news:acym9qha.fsf at python.net:

> Peter Hansen <peter at engcorp.com> writes:
> 
>> Grant Edwards wrote:
>>
>>> I'm trying to package a small Python program using py2exe.
>>> Everything works fine until I add an "include serial", then py2exe
>>> fails because
>>>   The following modules appear to be missing
>>>   ['javax.comm']
>>
>> Actually, you are assuming too much.  It's a warning, not a failure.
>> The .exe file is generated and will run just fine under Windows.
>>
>> Don't bother editing PySerial!  You'll just create a maintenance
>> hassle for yourself.
> 
> Right.  pyserial probably uses the same code for CPython and Jython,

almost. my package __init__.py has an if "sys.platform" .. and imports the 
platform implementation from an other file.

however, as Roger also pointed out, it's the module finder that just 
catches all imports. but well, it's maybe a bit inapropriate to follow up 
on Thomas' post he sure knows how py2exe works ;-)

> if you want to avoid the warning you should exclude 'javax.comm' from
> the build, either with the '--excludes javax.comm' command line option,
> or by passing something like this to the setup function in your build
> script:
> 
> setup(...
>       options = {'py2exe': {'excludes': ['javax.comm']}})

yes. maybe i should put that in the docs... ok, done, i also added a 
setup_demo.py for py2exe in the pyserial examples (CVS on pyserial.sf.net)

and the funny part is that Grant now packages a third party module that 
contains code from him (with his name in the sources of course, in the 
posix implementation)
:-)

chris

-- 
Chris <cliechti at gmx.net>




More information about the Python-list mailing list