Registry / type-stubs / pyobjc-framework-virtualization

pyobjc-framework-virtualization

JSON →
library12.2pypypiunverified

pyobjc-framework-virtualization provides Python wrappers for Apple's Virtualization framework on macOS. It is part of the PyObjC project, a bidirectional bridge enabling Python scripts to interact with Objective-C libraries, including macOS Cocoa frameworks. The current version is 12.1, and it maintains an active release cadence, typically aligning with macOS SDK updates and Python version support.

pip install pyobjc-framework-virtualization
INSTALL
IMPORT
SIG · PYOBJC-FRAMEWORK-V
P
pyobjc-framework-virtualization
type-stubspythonv12.2
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.920 runs
build_error
glibc
py 3.103.920 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Virtualization
import Virtualization
The entire framework's bindings are typically imported as a top-level module named after the framework itself.
VZVirtualMachine
from Virtualization import VZVirtualMachine
Specific classes are accessed directly from the imported framework module.

This quickstart checks if the macOS Virtualization framework is supported on the current machine. This is the simplest interaction with the framework without requiring complex setup or specific entitlements. Actual virtual machine creation and execution involve more extensive configuration and may require specific macOS entitlements.

import Virtualization import os def check_virtualization_support(): print(f"Checking macOS Virtualization support...") if Virtualization.VZVirtualMachine.isSupported(): print("\u2705 macOS Virtualization framework is supported on this machine.") print(" You can now proceed to create VZVirtualMachineConfiguration objects and manage virtual machines.") # Further steps would involve creating a VZVirtualMachineConfiguration, # setting up devices, and booting a guest OS, which is beyond a quickstart. # Example of a next step (not fully runnable without more config): # config = Virtualization.VZVirtualizationMachineConfiguration.alloc().init() # if config.validateWithError_(None): # print(" Basic VZVirtualMachineConfiguration object could be initialized.") else: print("\u274C macOS Virtualization framework is NOT supported on this machine.") print(" Requires macOS 11 or later and Apple Silicon or Intel with VT-x.") if __name__ == "__main__": check_virtualization_support()
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 Python 3.8. Ensure your Python version is compatible with the PyObjC version you are installing.
fix
Upgrade your Python environment to Python 3.10 or later for PyObjC 12.x. Always check `requires_python` on PyPI or the PyObjC changelog for specific version requirements.
affects: 11.0, 12.0
breakingPyObjC 11.1 changed how Objective-C initializer methods (those in the `init` family) are modeled, now correctly reflecting that they 'steal' a reference to `self` and return a new one, as per clang's Automatic Reference Counting (ARC) documentation. This affects object lifecycle and reference counting.
fix
Review code that interacts with object initialization, especially custom subclasses or factory methods, to ensure correct reference handling. Explicit memory management is rarely needed in Python, but understanding the underlying Objective-C semantics is crucial for correct behavior.
affects: >=11.1
gotchaActual creation and running of `VZVirtualMachine` instances typically requires your application to have the `com.apple.security.virtualization` entitlement. Without this, operations like `start()` may fail with permission errors.
fix
Ensure your macOS application (or a development sandbox configuration) includes the `com.apple.security.virtualization` entitlement to fully utilize the Virtualization framework. This is usually configured in Xcode for native applications.
affects: All
gotchaPyObjC 10.3 temporarily removed support for calling `__init__` on Python classes that also define a user-implemented `__new__` method, causing breakage in some projects. This was reverted in version 10.3.1. [from prompt]
fix
If encountering issues with custom `__new__` and `__init__` behavior, upgrade to PyObjC 10.3.1 or later.
affects: 10.3
gotchaPyObjC is a wrapper for macOS-specific frameworks. Therefore, `pyobjc-framework-virtualization` is only functional on macOS and is not intended for cross-platform use.
fix
Ensure your development and deployment environment is macOS to use this library.
affects: All
Upgrade
Version history
12.2latest on PyPI · released May 30, 2026
Audit
Dependencies
pyobjc-corerequiredCore bridge for Python and Objective-C communication.
pyobjc-framework-CocoarequiredProvides fundamental macOS UI and app infrastructure classes, often implicitly used or required by other frameworks.
Agent activity
47 hits · last 30 days
node
42
OpenAI (training)
2
Resources
pyobjc-framework-virtualization — pip install pyobjc-framework-virtualization · libregistry