Opened 3 weeks ago

Closed 2 weeks ago

#71103 closed defect (fixed)

py312-pyobjc @10.1_0: ModuleNotFoundError: No module named 'Quartz'

Reported by: breun (Nils Breunese) Owned by: danchr (Dan Villiom Podlaski Christiansen)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: py-pyobjc

Description (last modified by breun (Nils Breunese))

According to https://pyobjc.readthedocs.io/en/latest/notes/quartz-vs-coregraphics.html PyObjC should provide for 'import Quartz'. However, with the python312 and py312-pyobjc ports installed on macOS 15.0.1 arm64, I get the following:

❯ port installed python312 py312-pyobjc
The following ports are currently installed:
  py312-pyobjc @10.1_0 (active)
  python312 @3.12.7_0+lto+optimizations (active)
❯ /opt/local/bin/python3.12
Python 3.12.7 (main, Oct  5 2024, 01:39:55) [Clang 16.0.0 (clang-1600.0.26.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import Quartz
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'Quartz'

Attachments (1)

py312-objc-install-debug.log.gz (363.7 KB) - added by breun (Nils Breunese) 3 weeks ago.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 3 weeks ago by breun (Nils Breunese)

Description: modified (diff)

comment:2 Changed 3 weeks ago by jmroot (Joshua Root)

The port is several versions behind upstream, so updating would be the first thing to try.

comment:3 Changed 3 weeks ago by jmroot (Joshua Root)

Port: py-pyobjc added; py312-pyobjc removed
Summary: ModuleNotFoundError: No module named 'Quartz'py312-pyobjc @10.1_0: ModuleNotFoundError: No module named 'Quartz'

comment:4 Changed 3 weeks ago by breun (Nils Breunese)

I've updated to 10.3.1 locally (PR: https://github.com/macports/macports-ports/pull/26182), but that doesn't help with this issue:

❯ sw_vers 
ProductName:            macOS
ProductVersion:         15.0.1
BuildVersion:           24A348
❯ port installed py312-pyobjc
The following ports are currently installed:
  py312-pyobjc @10.3.1_0 (active)
❯ /opt/local/bin/python3.12  
Python 3.12.7 (main, Oct  5 2024, 01:39:55) [Clang 16.0.0 (clang-1600.0.26.3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import Quartz
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'Quartz'
Last edited 3 weeks ago by breun (Nils Breunese) (previous) (diff)

comment:5 Changed 3 weeks ago by breun (Nils Breunese)

This does work for someone on macOS Ventura 13.7 according to https://lists.macports.org/pipermail/macports-dev/2024-October/045891.html.

comment:6 Changed 3 weeks ago by reneeotten (Renee Otten)

looks like you would need the [PyObsj-framework-Quartz https://pypi.org/project/pyobjc-framework-Quartz/] packages. I would kind of assume that this would be part of the py-pyobjc port but that's something to check.

comment:7 Changed 3 weeks ago by breun (Nils Breunese)

I don’t know how I can check, but the fact that it works for someone on macOS 13 makes me think it should be included.

Changed 3 weeks ago by breun (Nils Breunese)

comment:8 Changed 3 weeks ago by breun (Nils Breunese)

On the macports-dev mailinglist jmroot wrote: "PyObjC consists of a number of python modules. Each has its own directory in site-packages: AVFoundation, AVKit, etc. through to WebKit."

In /opt/local/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages I see several directories with names that start with pyobjc_framework_. I don't see any such directory with Quartz in its name, but I also don't know if I should.

I've attached the output of sudo port install -d py312-pyobjc.

Last edited 3 weeks ago by breun (Nils Breunese) (previous) (diff)

comment:9 Changed 3 weeks ago by jmroot (Joshua Root)

It's our old friend again.

Modules/_coregraphics.m:243:17: error: 'CGWindowListCreateImageFromArray' is unavailable: obsoleted in macOS 15.0 - Please use ScreenCaptureKit instead.
  243 |                 CGWindowListCreateImageFromArray(screenBounds, windowArray, imageOption);
      |                 ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindow.h:280:33: note: 'CGWindowListCreateImageFromArray' has been explicitly marked unavailable here
  280 | CG_EXTERN CGImageRef __nullable CGWindowListCreateImageFromArray(
      |                                 ^

comment:10 Changed 3 weeks ago by breun (Nils Breunese)

I'm not familiar with this 'old friend'. Does this indicate that pyobjc-framework-Quartz is currently not compatible with macOS 15? Should this be reported upstream?

comment:11 Changed 3 weeks ago by breun (Nils Breunese)

comment:12 in reply to:  10 Changed 3 weeks ago by kencu (Ken)

Replying to breun:

I'm not familiar with this 'old friend'.

See the explanation in SequoiaProblems

comment:13 Changed 3 weeks ago by breun (Nils Breunese)

Ah thanks, setting the deployment target to 14 indeed seems to help. PR here: https://github.com/macports/macports-ports/pull/26229

comment:14 Changed 2 weeks ago by Nils Breunese <breun@…>

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.