Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.12 support #2153

Closed
marcelotduarte opened this issue Dec 3, 2023 · 6 comments · Fixed by #2347
Closed

Python 3.12 support #2153

marcelotduarte opened this issue Dec 3, 2023 · 6 comments · Fixed by #2347

Comments

@marcelotduarte
Copy link
Owner

cx_Freeze 6.15.x supports Python 3.7 to 3.11 in all OSes.

cx_Freeze development version supports Python 3.12, but its dependencies for Windows (cx_Logging, Lief) are not yet compatible with Python 3.12 and do not provide wheels.

So, you can test the latest development build (we provide all necessary wheels):
pip install --force --no-cache --pre --extra-index-url https://marcelotduarte.github.io/packages/ cx_Freeze

For conda-forge the command is:
conda install -y --no-channel-priority -S -c https://marcelotduarte.github.io/packages/conda cx_Freeze

@marcelotduarte marcelotduarte pinned this issue Dec 3, 2023
@jmarcet
Copy link

jmarcet commented Jan 9, 2024

@marcelotduarte This was working fine until last weekend, since then I cannot freeze anymore the same codebase (the data= is mine):

copying C:\Users\jmarcet\scoop\apps\openjdk17\17.0.2-8\bin\api-ms-win-core-console-l1-2-0.dll -> C:\Users\jmarcet\src\movistar-u7d\build\exe.win-amd64-3.12\api-ms-win-core-console-l1-2-0.dll
copying C:\Users\jmarcet\scoop\apps\python312\3.12.1\python312.dll -> C:\Users\jmarcet\src\movistar-u7d\build\exe.win-amd64-3.12\python312.dll
WARNING: cannot find 'api-ms-win-core-path-l1-1-0.dll'
copying C:\Users\jmarcet\scoop\persist\python312\Lib\site-packages\cx_Freeze\bases\console-cpython-312-win_amd64.exe -> C:\Users\jmarcet\src\movistar-u7d\build\exe.win-amd64-3.12\movistar_epg.exe
copying C:\Users\jmarcet\scoop\persist\python312\Lib\site-packages\cx_Freeze\initscripts\frozen_application_license.txt -> C:\Users\jmarcet\src\movistar-u7d\build\exe.win-amd64-3.12\frozen_application_license.txt
data=72092
Traceback (most recent call last):
  File "C:\Users\jmarcet\src\movistar-u7d\setup.py", line 25, in <module>
    setup(
  File "C:\Users\jmarcet\scoop\apps\python312\current\Lib\site-packages\cx_Freeze\__init__.py", line 68, in setup
    setuptools.setup(**attrs)
  File "C:\Users\jmarcet\scoop\apps\python312\current\Lib\site-packages\setuptools\__init__.py", line 103, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jmarcet\scoop\apps\python312\current\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
    return run_commands(dist)
           ^^^^^^^^^^^^^^^^^^
  File "C:\Users\jmarcet\scoop\apps\python312\current\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
    dist.run_commands()
  File "C:\Users\jmarcet\scoop\apps\python312\current\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "C:\Users\jmarcet\scoop\apps\python312\current\Lib\site-packages\setuptools\dist.py", line 963, in run_command
    super().run_command(command)
  File "C:\Users\jmarcet\scoop\apps\python312\current\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
    cmd_obj.run()
  File "C:\Users\jmarcet\scoop\apps\python312\current\Lib\site-packages\setuptools\_distutils\command\build.py", line 131, in run
    self.run_command(cmd_name)
  File "C:\Users\jmarcet\scoop\apps\python312\current\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "C:\Users\jmarcet\scoop\apps\python312\current\Lib\site-packages\setuptools\dist.py", line 963, in run_command
    super().run_command(command)
  File "C:\Users\jmarcet\scoop\apps\python312\current\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
    cmd_obj.run()
  File "C:\Users\jmarcet\scoop\apps\python312\current\Lib\site-packages\cx_Freeze\command\build_exe.py", line 284, in run
    freezer.freeze()
  File "C:\Users\jmarcet\scoop\apps\python312\current\Lib\site-packages\cx_Freeze\freezer.py", line 731, in freeze
    self._freeze_executable(executable)
  File "C:\Users\jmarcet\scoop\apps\python312\current\Lib\site-packages\cx_Freeze\freezer.py", line 323, in _freeze_executable
    self._add_resources(exe)
  File "C:\Users\jmarcet\scoop\apps\python312\current\Lib\site-packages\cx_Freeze\freezer.py", line 794, in _add_resources
    version.stamp(target_path)
  File "C:\Users\jmarcet\scoop\apps\python312\current\Lib\site-packages\cx_Freeze\winversioninfo.py", line 240, in stamp
    handle, RT_VERSION, ID_VERSION, string_version_info.to_buffer()
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jmarcet\scoop\apps\python312\current\Lib\site-packages\cx_Freeze\winversioninfo.py", line 96, in to_buffer
    data = pack(fmt, data)
           ^^^^^^^^^^^^^^^
struct.error: 'H' format requires 0 <= number <= 65535

This is on Windows 11 with all the available updates applied. Not sure what changed, neither the code I'm trying to freeze nor cx_Freeze, which has not changed since the last successful frozen code I got.

@marcelotduarte
Copy link
Owner Author

@jmarcet Please open a new issue. This error is related to the version used, it has nothing to do with Python 3.12.
You used 6.0alpha which caused the error.

@marcelotduarte
Copy link
Owner Author

Support Ubuntu Linux 24.04 (Noble Nimbat) PR #2303

@gbtami
Copy link

gbtami commented Apr 20, 2024

After cx_Logging and Lief has python 3.12 packages on pypi, is there anything needed to a new release with 3.12 support?

@marcelotduarte
Copy link
Owner Author

Release 7.0.0 is out!
Documentation

@gbtami
Copy link

gbtami commented Apr 21, 2024

Thx a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants