diff --git a/doc/source/getting_started/install.rst b/doc/source/getting_started/install.rst index 6c245a0668394..e5c6a69ce0e30 100644 --- a/doc/source/getting_started/install.rst +++ b/doc/source/getting_started/install.rst @@ -262,7 +262,6 @@ Visualization ========================= ================== ============================================================= Dependency Minimum Version Notes ========================= ================== ============================================================= -setuptools 38.6.0 Utils for entry points of plotting backend matplotlib 3.3.2 Plotting library Jinja2 2.11 Conditional formatting with DataFrame.style tabulate 0.8.7 Printing in Markdown-friendly format (see `tabulate`_) diff --git a/doc/source/whatsnew/v1.4.0.rst b/doc/source/whatsnew/v1.4.0.rst index 764a50e13586a..2daea368af3b6 100644 --- a/doc/source/whatsnew/v1.4.0.rst +++ b/doc/source/whatsnew/v1.4.0.rst @@ -82,8 +82,6 @@ If installed, we now require: +-----------------+-----------------+----------+---------+ | mypy (dev) | 0.910 | | X | +-----------------+-----------------+----------+---------+ -| setuptools | 38.6.0 | | | -+-----------------+-----------------+----------+---------+ For `optional libraries `_ the general recommendation is to use the latest version. The following table lists the lowest version per library that is currently being tested throughout the development of pandas. diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index 302d5ede0ae86..268d336325db4 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -1743,7 +1743,7 @@ def _load_backend(backend: str) -> types.ModuleType: types.ModuleType The imported backend. """ - import pkg_resources + from importlib.metadata import entry_points if backend == "matplotlib": # Because matplotlib is an optional dependency and first-party backend, @@ -1759,11 +1759,13 @@ def _load_backend(backend: str) -> types.ModuleType: found_backend = False - for entry_point in pkg_resources.iter_entry_points("pandas_plotting_backends"): - found_backend = entry_point.name == backend - if found_backend: - module = entry_point.load() - break + eps = entry_points() + if "pandas_plotting_backends" in eps: + for entry_point in eps["pandas_plotting_backends"]: + found_backend = entry_point.name == backend + if found_backend: + module = entry_point.load() + break if not found_backend: # Fall back to unregistered, module name approach.