I tried using the 'dll_include' option like you suggested Andrea.
Neither 'dll_include' nor 'dll_includes' exist as a py2exe option.

So I tried 'includes' : '_chilkay.pyd'   which also errored saying that no module could be found.
So I tried 'includes': '_chilkat'     , this did compile with no errors.

Yet, I still have the same error when I try to run the application.

Also, in order to use the chilkat module, you must have chilkat.py and _chilkat.pyd  in the root directory of the script doing 'import chilkat'
You say it's a bug in the chlkat module, but I can run my script fine with no errors, while the py2exe application errors.

py2exe is supposed to compile an application that emulates what the python script does right?
It's not doing that.
It seems to be a bug in py2exe then...  or someone please tell me what option I need to run to get it to compile and run with no errors.

PYD files are synonymous with dlls, but are special python-like dllls, does py2exe have an option to correctly compile when these are dependencies?

In my last post I gave you enough information for you to try this yourself. Can you try it please?





On Sat, Aug 28, 2010 at 4:16 PM, Andrea Gavana <andrea.gavana@gmail.com> wrote:
Hi,

On 28 August 2010 21:50, Mark Swalaski wrote:
> Here's the begg. of the chilkat.py module:
> from sys import version_info
> if version_info >= (2,6,0):
>     def swig_import_helper():
>         from os.path import dirname
>         import imp
>         try:
>             fp, pathname, description = imp.find_module('_chilkat',
> [dirname(__file__)])
>             _mod = imp.load_module('_chilkat', fp, pathname, description)
>         finally:
>             if fp is not None: fp.close()

This will never work, "fp" is undefined if the try: block does not
execute because of some error. It's a bug in this chilkat module,
whatever it is.

> As you can see it relies on another file to be present in the root, which is
> the _chilkat.pyd  file.
>
> When I compile my script, I can find the _chilkat.pyd and chilkat.py  file
> in the /collect-26/  build directory. It looks like py2e is finding it?

I suggest you to explicitly include the chilkat module using the
"dll_include" option of py2exe, or the "package" option as an
alternative.

>
> When I run the compiled script, I get errors:
> Traceback (most recent call last):
>   File "extract_file.py", line 1, in <module>
>   File "zipextimporter.pyc", line 82, in load_module
>   File "C:\scripts\g\ChilkatPython26\chilkatPython26\chilkat.py", line 19,
> in <module>
>     _chilkat = swig_import_helper()
>   File "C:\scripts\g\ChilkatPython26\chilkatPython26\chilkat.py", line 17,
> in swig_import_helper
>     if fp is not None: fp.close()
> UnboundLocalError: local variable 'fp' referenced before assignment
> Traceback (most recent call last):
>   File "extract_file.py", line 1, in <module>
>   File "zipextimporter.pyc", line 82, in load_module
>   File "C:\scripts\g\ChilkatPython26\chilkatPython26\chilkat.py", line 19,
> in <module>
>     _chilkat = swig_import_helper()
>   File "C:\scripts\g\ChilkatPython26\chilkatPython26\chilkat.py", line 17,
> in swig_import_helper
>     if fp is not None: fp.close()
> UnboundLocalError: local variable 'fp' referenced before assignment
> Traceback (most recent call last):
>   File "extract_file.py", line 1, in <module>
>   File "zipextimporter.pyc", line 82, in load_module
>   File "C:\scripts\g\ChilkatPython26\chilkatPython26\chilkat.py", line 19,
> in <module>
>     _chilkat = swig_import_helper()
>   File "C:\scripts\g\ChilkatPython26\chilkatPython26\chilkat.py", line 17,
> in swig_import_helper
>     if fp is not None: fp.close()
> UnboundLocalError: local variable 'fp' referenced before assignment
>
>
>
>
> So what do you think is going on here?
> My hunch is that py2exe did not properly put _chilkat.pyd where's it
> supposed to go in order for the script to utilize it, since these errors
> related to _chilkat.pyd or chilkat.py.
>
> Is there a way to give py2exe in the setup script a location for required
> PYD files?

See above.


Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

==> Never *EVER* use RemovalGroup for your house removal. You'll
regret it forever.
http://thedoomedcity.blogspot.com/2010/03/removal-group-nightmare.html <==

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Py2exe-users mailing list
Py2exe-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/py2exe-users