Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panos use deprecated distutils library, not existing in current python (3.12 and later) #580

Open
radekwo opened this issue Nov 3, 2024 · 2 comments
Labels

Comments

@radekwo
Copy link

radekwo commented Nov 3, 2024

Describe the bug

The panos library is incompatible with Python 3.12 and newer, because it uses the deprecated distutils library.
Distutils library was removed in python version 3.12

Expected behavior

Please rewrite panos library code, replace distutils.version and allow to use current python version (3.12, 3.13)

Current behavior

Traceback (most recent call last):
  File "C:\Users\radek\PycharmProjects\paloapi\test1.py", line 1, in <module>
    from panos import firewall
  File "C:\Users\radek\PycharmProjects\paloapi\.venv\Lib\site-packages\panos\__init__.py", line 35, in <module>
    from distutils.version import LooseVersion  # Used by PanOSVersion class
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'distutils'
> python --version
Python 3.12.7

Steps to reproduce

Try run code below in python 3.12 or newer.

from panos import firewall
fw = firewall.Firewall("192.168.66.1", api_username="admin", api_password="admin")
print (fw.op("show system info"))
@radekwo radekwo added the bug label Nov 3, 2024
@nikolay-matveev-kkr
Copy link

Try pip install setuptools. This should fix the issue you're experiencing.

@bmigette
Copy link
Contributor

While installing manually setuptools would fix the issue, the package requirements should be updated if it is required. This breaks CI/CD flows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants