The PAN-OS SDK for Python is a package to help interact with Palo Alto Networks devices (including physical and virtualized Next-generation Firewalls and Panorama). The pan-os-python SDK is object oriented and mimics the traditional interaction with the device via the GUI or CLI/API.
The distutils package which is required for the version checks in pan-os-python has been removed in python 3.12.
PEP 632: Remove the distutils package. See the migration guide for advice replacing the APIs it provided. The third-party Setuptools package continues to provide distutils, if you still require it in Python 3.12 and beyond.
Expected behavior
pan-os-python should work.
Current behavior
File "/Users/someuser/.local/pipx/venvs/somevenv/lib/python3.12/site-packages/panos/init.py", line 35, in
from distutils.version import LooseVersion # Used by PanOSVersion class
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'distutils'
Possible solution
Follow the migration guide and use the packaging package instead.
Describe the bug
The
distutils
package which is required for the version checks in pan-os-python has been removed in python 3.12.Expected behavior
pan-os-python should work.
Current behavior
Possible solution
Follow the migration guide and use the
packaging
package instead.