Skip to content

Commit c6557c6

Browse files
authored
Merge pull request #30486 from geofft/python-build-standalone-tkinter-doc
doc: Update warnings about python-build-standalone
2 parents a7e81ef + d2b3e95 commit c6557c6

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

doc/install/index.rst

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,20 @@ precompiled wheel for your OS and Python.
2828

2929
.. note::
3030

31-
The following backends work out of the box: Agg, ps, pdf, svg
32-
33-
Python is typically shipped with tk bindings which are used by
34-
TkAgg. Notably, python-build-standalone – used by ``uv`` – does
35-
not include tk bindings that are usable by Matplotlib.
31+
The following non-interactive backends work out of the box: Agg,
32+
ps, pdf, svg
33+
34+
The TkAgg interactive backend also typically works out of the box.
35+
It requires Tk bindings, which are usually provided via the Python
36+
standard library's ``tkinter`` module. On some OSes, you may need
37+
to install a separate package like ``python3-tk`` to add this
38+
component of the standard library.
39+
40+
Some tools like ``uv`` make use of Python builds from the
41+
python-build-standalone project, which only gained usable Tk
42+
bindings recently (August 2025). If you are having trouble with the
43+
TkAgg backend, ensure you have an up-to-date build, e.g. ``uv self
44+
update && uv python upgrade --reinstall``.
3645

3746
For support of other GUI frameworks, LaTeX rendering, saving
3847
animations and a larger selection of file formats, you can

doc/install/quick_install.inc.rst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,19 @@
2929
3030
.. warning::
3131

32-
If you install Python with ``uv`` then the ``tkagg`` backend
33-
will not be available because python-build-standalone (used by uv
34-
to distribute Python) does not contain tk bindings that are usable by
35-
Matplotlib (see `this issue`_ for details). If you want Matplotlib
36-
to be able to display plots in a window, you should install one of
37-
the other :ref:`supported GUI frameworks <optional_dependencies>`,
38-
e.g.
32+
uv usually installs its own versions of Python from the
33+
python-build-standalone project, and only recent versions of those
34+
Python builds (August 2025) work properly with the ``tkagg`` backend
35+
for displaying plots in a window. Please make sure you are using uv
36+
0.8.7 or newer (update with e.g. ``uv self update``) and that your
37+
bundled Python installs are up to date (with ``uv python upgrade
38+
--reinstall``). Alternatively, you can use one of the other
39+
:ref:`supported GUI frameworks <optional_dependencies>`, e.g.
3940

4041
.. code-block:: bash
4142
4243
uv add matplotlib pyside6
4344
44-
.. _this issue: https://github.com/astral-sh/uv/issues/6893#issuecomment-2565965851
45-
4645
.. tab-item:: other
4746

4847
:ref:`install-official`

0 commit comments

Comments
 (0)