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

[BUG] Build fails in macOS - problem with icon #90

Open
acyment opened this issue Aug 21, 2023 · 1 comment
Open

[BUG] Build fails in macOS - problem with icon #90

acyment opened this issue Aug 21, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@acyment
Copy link

acyment commented Aug 21, 2023

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


**System Information (please complete the following information):**
 - OS: macOS 13.5
 - OnTheSpot Version: 0.5 (downloaded sources on Aug 21th 2023)

**Additional context**
I converted the png file to icns, changed all 4 references to "png" to "icns" in build_mac.sh and build finished successfuly. Not sure if pull requests were accepted
@acyment acyment added the bug Something isn't working label Aug 21, 2023
@cappucorn
Copy link

Adding pip install --upgrade --force-reinstall Pillow in build_mac.sh seems to fix the issue:

...
echo " => Installing dependencies to venv with pip..."
pip install -r requirements.txt
pip install --upgrade --force-reinstall Pillow
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants