Registry /
web-framework / pyobjc-framework-mapkit
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.940 runs
build_error
glibcpy 3.10–3.940 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
MKMapView
✓ from MapKit import MKMapView
CLLocationCoordinate2D
✓ from MapKit import CLLocationCoordinate2D
NSApplication
✓ from AppKit import NSApplication
Commonly needed for GUI applications using AppKit alongside MapKit.
This quickstart demonstrates how to create a basic macOS application window using AppKit, then embed and display an MKMapView from the MapKit framework, centering it on a specific geographical coordinate. It requires running on macOS with a functional PyObjC installation.
import objc
from AppKit import NSApplication, NSWindow, NSView, NSMakeRect, NSApp
from Foundation import NSObject
from MapKit import MKMapView, CLLocationCoordinate2D, MKCoordinateSpan, MKCoordinateRegion
class AppDelegate(NSObject):
def applicationDidFinishLaunching_(self, notification):
print("PyObjC MapKit Application Launched!")
# Create a window
self.window = NSWindow.alloc().initWithContentRect_styleMask_backing_defer_(
NSMakeRect(100, 100, 800, 600),
(NSWindow.NSTitledWindowMask | NSWindow.NSClosableWindowMask | NSWindow.NSResizableWindowMask),
NSWindow.NSBackingStoreBuffered,
False
)
self.window.setTitle_("PyObjC MapKit Example")
# Create an MKMapView
self.mapView = MKMapView.alloc().initWithFrame_(self.window.contentView().frame())
self.mapView.setAutoresizingMask_(NSView.NSViewWidthSizable | NSView.NSViewHeightSizable)
# Define a location (e.g., San Francisco)
coordinate = CLLocationCoordinate2D(latitude=37.7749, longitude=-122.4194)
span = MKCoordinateSpan(latitudeDelta=0.1, longitudeDelta=0.1)
region = MKCoordinateRegion(center=coordinate, span=span)
self.mapView.setRegion_(region)
# Add the map view to the window
self.window.contentView().addSubview_(self.mapView)
self.window.makeKeyAndOrderFront_(None)
def applicationShouldTerminateAfterLastWindowClosed_(self, sender):
return True
# Initialize and run the application
app = NSApplication.sharedApplication()
delegate = AppDelegate.alloc().init()
app.setDelegate_(delegate)
NSApp.run()
Debug
Known issues
breakingPyObjC frequently drops support for older Python versions. PyObjC 12.0 dropped support for Python 3.9, and PyObjC 11.0 dropped support for Python 3.8. Always check the release notes for minimum Python requirements.fixUpgrade to a supported Python version (3.10 or later for PyObjC 12.x) or pin an older PyObjC version compatible with your Python environment.
affects: 11.0, 12.0
breakingPyObjC 11.1 aligned its Automatic Reference Counting (ARC) semantics for Objective-C 'init' methods with `clang` documentation. This means 'init' methods now correctly steal a reference to `self` and return a new reference, which can affect memory management and object lifecycle if custom `__new__` or `__init__` methods are used without careful consideration.fixReview custom Python `__new__` and `__init__` methods on Objective-C subclasses to ensure correct reference handling, especially when dealing with `alloc()` and `init*()` patterns. Refer to PyObjC's documentation on memory management.
affects: >=11.1
gotchaPyObjC 10.3 introduced changes to how `__init__` interacts with `__new__`. While `__init__` was initially disallowed for classes using PyObjC's `__new__`, version 10.3.1 reintroduced support for `__init__` when a user-defined `__new__` is present. However, code relying on the PyObjC-provided `__new__` still cannot use `__init__`.fixIf implementing custom object creation, use `__new__` for Objective-C object setup and ensure `__init__` is only used when a custom `__new__` is explicitly defined. Avoid relying on `__init__` directly on PyObjC-bridged classes without a custom `__new__`.
affects: 10.3, 10.3.1
gotchaPyObjC introduced experimental support for Python 3.13's free-threading (PEP 703) in version 11.0. However, subsequent release notes (e.g., for v10.3, mentioning 3.13 support) clarified that PyObjC does *not* fully support free threading at this time. Attempting to use free-threading features with PyObjC may lead to undefined behavior or crashes.fixAvoid using Python's experimental free-threading features with PyObjC until explicit full support is announced. Continue to use PyObjC in single-threaded contexts or with traditional Python threading models.
affects: >=11.0 (with Python 3.13+)
breakingPyObjC frameworks are closely tied to macOS SDKs. Older or deprecated frameworks may be removed from PyObjC bindings as they are removed from macOS itself. For instance, `IMServicePlugIn` bindings were removed in PyObjC 10.0 because the framework was deprecated in macOS 10.13 and removed in macOS 14.fixIf migrating to a newer PyObjC version or macOS, review your application for usage of frameworks that may have been deprecated or removed by Apple. Update to modern alternatives where necessary. This is a common pattern across all `pyobjc-framework-*` packages.
affects: >=10.0
Upgrade
Version history
12.2latest on PyPI · released May 30, 2026
Audit
Dependencies
pyobjc-corerequiredProvides the core bridge between Python and Objective-C, essential for all PyObjC framework bindings.