Re: [Py2exe-users] catia typelib problem
by Mark Hammond other posts by this author
Sep 21 2006 1:04AM messages near this date
[Py2exe-users] catia typelib problem
|
Re: [Py2exe-users] catia typelib problem
> I've seen the page in the wiki
<http://www.py2exe.org/index.cgi/IncludingTypelibs>
> about this
Interestingly, the footnote of solution 2 appears incorrect. It asserts
solution 2 itself doesn't work - but I believe it should work fine. It's is
unsuitable for some applications though, but is regardless of py2exe.
Also, I'm a little confused about solution 3. Solution 1 does *not* require
the typelibs to be installed on the target machine - that is the point. It
is possible, for example, to have Office installed, but not all the typelibs
necessary to implement a plugin. That option should mean Python never needs
to load any typelibs on the target machine (and therefore obviously avoids
depending on installed typelibs). Regarding newer versions of the typelib,
that is only a problem if the vendor actually breaks old interfaces - but
either way, it should be possible to include multiple versions of the same
typelib.
OTOH, a problem spambayes is facing is that *developers* may not always have
all typelibs installed. Eg, spambayes ships with files generated from the
Office2k typelibs (as that still works with newer versions of office) - but
many people only have later versions installed. If spambayes ships with
only the newer versions, it will no longer work for users of Office2k. We
need a strategy that allows the generated files to be checked into source
control, but still be recognised by py2exe.
I really need to document that better, with examples.
> Now I'm trying solution 2.
Did you mean solution 1? Solution 2 does not involve py2exe options.
> CATIA has 102 typelibs so I pasted them
> all into the setup.py file:
> options = {"py2exe": {"typelibs":
Ack - 102! That is amazing.
> But then when I run py2exe I get the following error message:
> C:\cygwin\usr\project\CSICM>python setup.py py2exe
> running py2exe
> running build_py
> *** generate typelib stubs ***
> creating
> C:\cygwin\usr\project\CSICM\build\bdist.win32\winexe\temp\win32com
> creating
> C:\cygwin\usr\project\CSICM\build\bdist.win32\winexe\temp\win3
> 2com\gen_p
> y
> Traceback (most recent call last):
> File "setup.py", line 121, in ?
> packages = ['kbe_catia']
> File "C:\Python24\Lib\distutils\core.py", line 149, in setup
> dist.run_commands()
> File "C:\Python24\Lib\distutils\dist.py", line 946, in
> run_commands
> self.run_command(cmd)
> File "C:\Python24\Lib\distutils\dist.py", line 966, in
> run_command
> cmd_obj.run()
> File "C:\Python24\Lib\site-packages\py2exe\build_exe.py", line
> 218, in run
> self._run()
> File "C:\Python24\Lib\site-packages\py2exe\build_exe.py", line
> 249, in _run
> self.typelibs)
> File "C:\Python24\Lib\site-packages\py2exe\build_exe.py", line
> 1495, in collect_win32com_genpy
> makepy.GenerateFromTypeLibSpec(info, bForDemand = False)
> File
> "C:\Python24\lib\site-packages\win32com\client\makepy.py",
> line 194, in
> GenerateFromTypeLibSpec
> tlb = pythoncom.LoadRegTypeLib(typelibCLSID, major, minor,
> lcid)
> pywintypes.com_error: (-2147312566, 'Error loading type
> library/DLL.', None, None)
>
> I googled for this error message and found this
> <http://mail.python.org/pipermail/python-win32/2004-September.txt> in
> which Mark Hammond states "typelibs can have references to other
> typelibs - loading one of these other references is what is failing."
> That was back in September, 2004. Has any solution been
> found for this
> problem ?
The problem you reference has been fixed - but I don't think it applies
here. The traceback indicates that a typelib you directly requested - so
one of the typelibs you asked for isn't installed on your machine.
Mark
Thread:
Michael K Fox
Mark Hammond
Michael K Fox
|