Skip to content

Commit

Permalink
rectify docs around Tkinter
Browse files Browse the repository at this point in the history
Will fix #36710
  • Loading branch information
dimpase committed Nov 23, 2023
1 parent f10820f commit 28a7848
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
8 changes: 5 additions & 3 deletions src/doc/en/faq/faq-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ How to get Sage's Python to recognize my system's Tcl/Tk install?
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

It may be that you have Tcl/Tk installed and that your system's Python
recognizes it but Sage's Python does not. To fix that, install the
tcl/tk development library. On Ubuntu, this is the command
recognizes it but Sage's Python does not. Normally speaking, there is little
need to build Sage's Python nowadays (anno 2023), but if you do, here it is.
Make sure you installed the tcl/tk development library. On Ubuntu, this is the
command

.. CODE-BLOCK:: shell-session
Expand All @@ -104,7 +106,7 @@ or something along that line. Next, reinstall Sage's Python:

.. CODE-BLOCK:: shell-session
$ sage -f python3
$ make python3-clean python3-uninstall && make python3
This will pick up the tcl/tk library automatically. After successfully
reinstalling Sage's Python, from within the Sage command line interface,
Expand Down
24 changes: 19 additions & 5 deletions src/doc/en/installation/source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -446,20 +446,34 @@ If you don't want conda to be used by sage, deactivate conda (for the current sh
operating system, or its own compilers.


Tcl/Tk
^^^^^^
Tcl/Tk (and system's Python)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you want to use `Tcl/Tk <https://www.tcl.tk/>`_ libraries in Sage, and you
are going to use your OS's Python3 as Sage's Python, you merely need to install
its **Tkinter** module. On Lunix systems, it is usually provided by the
**python3-tk** or a similarly named (e.g. **python3-tkinter**) package,
which can be installed using::

$ sudo apt-get install python3-tk

If you want to use `Tcl/Tk <https://www.tcl.tk/>`_ libraries in Sage, you need
to install the Tcl/Tk and its development headers before building Sage. Sage's
Python will then automatically recognize your system's install of Tcl/Tk.
or similar commands.

Tcl/Tk (and Sage's own Python)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you want to use `Tcl/Tk <https://www.tcl.tk/>`_ libraries in Sage,
and you are going to build Sage's Python from source, you need to install
these, and the corresponding headers.
On Linux systems, these are usually provided by the **tk** and **tk-dev**
(or **tk-devel**) packages which can be installed using::

$ sudo apt-get install tk tk-dev

or similar commands.


Sage's Python will then automatically recognize your system's install of Tcl/Tk.
If you installed Sage first, all is not lost. You just need to rebuild
Sage's Python and any part of Sage relying on it::

Expand Down

0 comments on commit 28a7848

Please sign in to comment.