ronaldoussoren / py2app

py2app is a Python setuptools command which will allow you to make standalone Mac OS X application bundles and plugins from Python scripts.
Other
340 stars 36 forks source link

python 3.12 support is broken? #496

Open ronaldoussoren opened 1 year ago

ronaldoussoren commented 1 year ago

Looks like Python 3.12 support isn't there after all. I did a clean install of beta 2 (removing the previous installation before installing), and it turns out py2app and modulegraph rely on some modules that were removed in 3.12 (in particular imp).

sirus-the-beaver commented 8 months ago

Python deprecated imp in favor of importlib: https://docs.python.org/3.11/library/imp.html

How/where is the imp module being used and would it be possible to migrate to using importlib?

sebastianhaberey commented 8 months ago

I am getting the same error

ModuleNotFoundError: No module named 'imp'
yauhen-info commented 7 months ago

For the py2app version 0.28.6 (latest as of Jan 20th, 2024), in build_app.py copilot suggest to replace import imp with import importlib.machinery, so in the same file in the line 1798 it can replace the exts = [i[0] for i in importlib.get_suffixes()] with exts = [i[0] for i in importlib.machinery.all_suffixes()]