Closed thorstenkampe closed 9 years ago
Could you also provide a minimal example of a script you are trying to turn into .exe? I couldn't reproduce the error. I have built .exe from the following script with no problem:
import win_unicode_console
win_unicode_console.enable()
while True:
print(input("α> "))
It looks like the option bundle_files': 1
in setup.py causes the problem; but only with with import win_unicode_console; win_unicode_console.enable()
- not for instance with import colorama; colorama.init()
. For reference, here is my complete setup.py:
from distutils.core import setup
import py2exe
setup(
console = [{'script': 'script.py',
'icon_resources': [(0, 'resources/Python.ico')]}],
zipfile = None,
# http://www.py2exe.org/index.cgi/ListOfOptions
# - equivalent to `--bundle-files 1 --compressed`
options = {'py2exe': {'bundle_files': 1,
'compressed': 1
}
}
)
I have no problem with bundle_files
or compressed
. If I call my example script echo.py
, then py -m py2exe.build_exe -b 1 -c echo.py
works fine.
The problem ist really "PyObject_GetBuffer = pythonapi.PyObject_GetBuffer" from buffer.py
. It works in PyInstaller, without Py2exe and without 'bundle_files': 1
. If it works for you then this looks like a Py2exe issue on my machine solely.
Are you running 32 or 64-bit Python?
I have tried both 32 and 64-bit and both works. Have you tried my minimal example? And what about bundle_files=2
?
It's obviously a ctypes/Py2exe issue so I"m closing this issue.
It looks like win-unicode-console is not compatible with py2exe (see below). Is this a known issue and is there any workaround?