py2exe crashes on simple program

John Nagle nagle at animats.com
Tue Jul 5 17:30:13 EDT 2016


On 7/4/2016 11:13 PM, Steven D'Aprano wrote:
> If you change it to "library.exe" does it work? Also, I consider this
> a bug in py2exe: - it's an abuse of assert, using it to check
> user-supplied input; - it's a failing assertion, which by definition
> is a bug.

   I'm not trying to build "library.zip". That's a work
file py2exe created.  If I delete it, it's re-created by py2exe.

The problem seems to be that my "setup.py" file didn't include
a "console" entry, which tells py2exe the build target.
Apparently, without that py2exe tries to build something bogus and
blows up.

After fixing that, the next error is

Building 'dist\baudotrss.exe'.
error: [Errno 2] No such file or directory: 'C:\\Program
Files\\Python35\\lib\\site-packages\\py2exe\\run-py3.5-win-amd64.exe'

Looks like Pip installed (yesterday) a version of py2exe that doesn't
support Python 3.5.  The py2exe directory contains
"run-py3.3-win-amd64.exe" and "run-py3.4-win-amd64.exe", but
not 3.5 versions.

That's what PyPi says at "https://pypi.python.org/pypi/py2exe".
The last version of py2exe was uploaded two years ago (2014-05-09)
and is for Python 3.4.  So of course it doesn't have the 3.5 binary
executable it needs.

Known problem. Stack Overflow reports py2exe is now broken for Python
3.5.  Apparently it's a non-trivial fix, too.

http://stackoverflow.com/questions/32963057/is-there-a-py2exe-version-thats-compatible-with-python-3-5

cx_freeze has been suggested as an alternative, but its own
documents indicate it's only been tested through Python 3.4.
Someone reported success with a development version.

I guess people don't create Python executables much.

				John Nagle





More information about the Python-list mailing list