app fails to launch with `ModuleNotFoundError: No module named 'jaraco.text'`
This appears to be similar to #412 .
An affected build can be found here: https://github.com/glyph/Pomodouroboros/releases/tag/0.4.6
Looks like it's another setuptools incompatibility and it can be addressed by downgrading to 70.3.0. I was trying to be clever after mitigating https://github.com/ronaldoussoren/py2app/issues/531 by upgrading as far as possible without getting to the "bad" version of 71+ but I should have stuck with the version suggested by others on that issue :)
Using py2app 0.28.8 and setuptools 70.3.0 I still get the error No module named 'jaraco.text'. Am I missing a workaround?
Hmm. Reviewing my build configuration, I don't see any other workarounds. Are you sure you've got that version of setuptools installed? Given the core nature of the dependency (i.e., pip needs it) you may need to separately, manually install it.
Hmm. Reviewing my build configuration, I don't see any other workarounds. Are you sure you've got that version of setuptools installed? Given the core nature of the dependency (i.e., pip needs it) you may need to separately, manually install it.
Oh, you're right. Somehow setuptools got upgraded after I downgraded it. I pushed it back again and I am now able to build with 70.3.0.
I found a workaround, if anyone has this problem and (like I am) is too lazy to upgrade.
First, in setup.py set { 'py2app': {'argv_emulation': False} } or inside OPTIONS, (idk your setup)
Finally, in file dist/<Your-App>/Contents/Resources/lib/python3.12/pkg_resources/__init__.py
- Delete line
from jaraco.text import drop_comment, join_continuation, yield_lines - Paste reimplementation of yield_lines after the imports and before
warnings.warn(
def yield_lines(strs):
for s in strs:
if hasattr(s, 'splitlines'):
for line in s.splitlines():
yield line
else:
yield s
drop_comment and join_continuation were not needed anywhere, I guess because of the disabled argv_emulation.
I just installed jaraco.text and added includes':['jaraco.text'] to my options, and it started working again.