mirror of
https://github.com/casualsnek/onthespot.git
synced 2026-04-27 04:55:57 +03:00
[GH-ISSUE #90] [BUG] Build fails in macOS - problem with icon #65
Labels
No labels
Feedback requested
bug
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/onthespot#65
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @acyment on GitHub (Aug 21, 2023).
Original GitHub issue: https://github.com/casualsnek/onthespot/issues/90
Describe the bug
Build fails in macOS, apparently due to a problem with the icon's format
To Reproduce
Try to run build_mac.sh on a Mac
Expected behavior
Build obtained in dist folder
Log```
3383 INFO: Building BUNDLE BUNDLE-00.toc
Traceback (most recent call last):
File "/Users/acyment/dev/onthespot/venv/lib/python3.11/site-packages/PyInstaller/building/icon.py", line 50, in normalize_icon_type
from PIL import Image as PILImage
ModuleNotFoundError: No module named 'PIL'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/acyment/dev/onthespot/venv/bin/pyinstaller", line 8, in
sys.exit(_console_script_run())
^^^^^^^^^^^^^^^^^^^^^
File "/Users/acyment/dev/onthespot/venv/lib/python3.11/site-packages/PyInstaller/main.py", line 194, in _console_script_run
run()
File "/Users/acyment/dev/onthespot/venv/lib/python3.11/site-packages/PyInstaller/main.py", line 180, in run
run_build(pyi_config, spec_file, **vars(args))
File "/Users/acyment/dev/onthespot/venv/lib/python3.11/site-packages/PyInstaller/main.py", line 61, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "/Users/acyment/dev/onthespot/venv/lib/python3.11/site-packages/PyInstaller/building/build_main.py", line 1019, in main
build(specfile, distpath, workpath, clean_build)
File "/Users/acyment/dev/onthespot/venv/lib/python3.11/site-packages/PyInstaller/building/build_main.py", line 944, in build
exec(code, spec_namespace)
File "/Users/acyment/dev/onthespot/onthespot_mac.spec", line 52, in
app = BUNDLE(
^^^^^^^
File "/Users/acyment/dev/onthespot/venv/lib/python3.11/site-packages/PyInstaller/building/osx.py", line 115, in init
self.postinit()
File "/Users/acyment/dev/onthespot/venv/lib/python3.11/site-packages/PyInstaller/building/datastruct.py", line 184, in postinit
self.assemble()
File "/Users/acyment/dev/onthespot/venv/lib/python3.11/site-packages/PyInstaller/building/osx.py", line 140, in assemble
self.icon = normalize_icon_type(self.icon, ("icns",), "icns", CONF["workpath"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/acyment/dev/onthespot/venv/lib/python3.11/site-packages/PyInstaller/building/icon.py", line 54, in normalize_icon_type
raise ValueError(
ValueError: Received icon image '/Users/acyment/dev/onthespot/src/onthespot/resources/icon.png' which exists but is not in the correct format. On this platform, only ('icns',) images may be used as icons. If Pillow is installed, automatic conversion will be attempted. Please install Pillow or convert your 'png' file to one of ('icns',) and try again.
=> Setting executable permissions..
=> Cleaning ..
=> Done
@lunacoaster commented on GitHub (Mar 17, 2024):
Adding
pip install --upgrade --force-reinstall Pillowinbuild_mac.shseems to fix the issue:@babbage9010 commented on GitHub (May 6, 2025):
Thanks, this fixed the "Build fails in macOS" issue for me... now it builds, but my app won't actually run. Before this fix it would try to run, and macOS would give me an error popup. Now the app has an icon and I can double-click it, and in less than a second it has died with no sign of an error anywhere. The only issue I see during the build is this, but I don't know what it means:
Collecting PyQt5==5.15.9 (from -r requirements.txt (line 14))
Using cached PyQt5-5.15.9.tar.gz (3.2 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
pyproject.toml: line 7: using '[tool.sip.metadata]' to specify the project metadata is deprecated and will be removed in SIP v7.0.0, use '[project]' instead
Traceback (most recent call last):
File "/Users/xxx/yyy/onthespot/onthespot/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in
main()
File "/Users/xxx/yyy/onthespot/onthespot/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
json_out["return_val"] = hook(**hook_input["kwargs"])
File "/Users/xxx/yyy/onthespot/onthespot/venv/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 178, in prepare_metadata_for_build_wheel
whl_basename = backend.build_wheel(metadata_directory, config_settings)
File "/private/var/folders/c2/1gkmpys101n8rk35pvg2kl740000gn/T/pip-build-env-h2dkmylf/overlay/lib/python3.10/site-packages/sipbuild/api.py", line 28, in build_wheel
project = AbstractProject.bootstrap('wheel',
File "/private/var/folders/c2/1gkmpys101n8rk35pvg2kl740000gn/T/pip-build-env-h2dkmylf/overlay/lib/python3.10/site-packages/sipbuild/abstract_project.py", line 74, in bootstrap
project.setup(pyproject, tool, tool_description)
File "/private/var/folders/c2/1gkmpys101n8rk35pvg2kl740000gn/T/pip-build-env-h2dkmylf/overlay/lib/python3.10/site-packages/sipbuild/project.py", line 629, in setup
self.apply_user_defaults(tool)
File "/private/var/folders/c2/1gkmpys101n8rk35pvg2kl740000gn/T/pip-install-8fr4mp9l/pyqt5_29cb056ca3df4c6189d4535e1a2323ef/project.py", line 68, in apply_user_defaults
super().apply_user_defaults(tool)
File "/private/var/folders/c2/1gkmpys101n8rk35pvg2kl740000gn/T/pip-build-env-h2dkmylf/overlay/lib/python3.10/site-packages/pyqtbuild/project.py", line 51, in apply_user_defaults
super().apply_user_defaults(tool)
File "/private/var/folders/c2/1gkmpys101n8rk35pvg2kl740000gn/T/pip-build-env-h2dkmylf/overlay/lib/python3.10/site-packages/sipbuild/project.py", line 243, in apply_user_defaults
self.builder.apply_user_defaults(tool)
File "/private/var/folders/c2/1gkmpys101n8rk35pvg2kl740000gn/T/pip-build-env-h2dkmylf/overlay/lib/python3.10/site-packages/pyqtbuild/builder.py", line 49, in apply_user_defaults
raise PyProjectOptionException('qmake',
sipbuild.pyproject.PyProjectOptionException
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
@glassdimly commented on GitHub (Jun 28, 2025):
I got this initial error, but when I try to run from the cli I get
@glassdimly commented on GitHub (Jun 28, 2025):
I got this solved more or less and it's running.
A couple of changes
in ./build_mac.sh
in requirements.txt
If you want to see the errors from running the app, use
./dist/onthespot_mac.app/Contents/MacOS/onthespot_mac@glassdimly commented on GitHub (Jun 28, 2025):
Actually... try this: https://github.com/justin025/onthespot