PaloAltoNetworks / pan-os-python

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.
https://pan-os-python.readthedocs.io
ISC License
339 stars 166 forks source link

pan-os-python is incompatible with python 3.12 due to missing `distutils` package #529

Open pascal-hofmann opened 8 months ago

pascal-hofmann commented 8 months ago

Describe the bug

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.