pallets-eco / flask-admin

Simple and extensible administrative interface framework for Flask
https://flask-admin.readthedocs.io
BSD 3-Clause "New" or "Revised" License
5.69k stars 1.56k forks source link

DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('flask_admin.contrib')`. #2353

Open cancan101 opened 1 year ago

cancan101 commented 1 year ago

This line of code: https://github.com/flask-admin/flask-admin/blob/896fca64f7eb7970bb5775c2c9ff6b3a07c9de4a/flask_admin/contrib/__init__.py#L2 is triggering this warning:

/site-packages/flask_admin/contrib/__init__.py:2
/site-packages/flask_admin/contrib/__init__.py:2: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('flask_admin.contrib')`.
  Implementing implicit namespace packages (as specified in PEP [42]()0) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    __import__('pkg_resources').declare_namespace(__name__)
tanj commented 7 months ago

This now results in an exception in python 3.12

edit: I updated my pkg_resources file and that fixed this for me.