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

rectify docs around Tkinter #36719

Merged
merged 4 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 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
dimpase marked this conversation as resolved.
Show resolved Hide resolved

.. CODE-BLOCK:: shell-session

Expand All @@ -104,9 +106,9 @@ 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
This will pick up the Tcl/Tk library automatically. After successfully
reinstalling Sage's Python, from within the Sage command line interface,
issue these commands:

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 Linux systems, it is usually provided by the
**python3-tk** or a similarly named (e.g. **python3-tkinter**) package,
dimpase marked this conversation as resolved.
Show resolved Hide resolved
which can be installed using::

$ sudo apt-get install python3-tk
Copy link
Member

@mkoeppe mkoeppe Nov 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1 on adding ad-hoc installation commands for 1 platform. We can do better - dummy package with system package info (#31206).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take care of this in a follow up.


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
9 changes: 5 additions & 4 deletions src/doc/it/faq/faq-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,16 @@ Come posso far riconoscere la mia attuale installazione di Tcl/Tk all'interprete
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

Potresti avere la libreria Tcl/Tk installata e l'interprete Python del
tuo sistema la riconosce ma l'interprete Python di Sage no.
Per risolvere questo ti basta installare la libreria di sviluppo
Tcl/Tk. Su Ubuntu lancia, da riga di comando::
tuo sistema la riconosce ma l'interprete Python di Sage no. Ad oggi (2023)
solitamente non c'è bisogno di compilare l'interprete Python di Sage, ma se ne
hai bisogno, segui queste istruzioni. Controlla di aver installato la libreria
di sviluppp Tcl/Tk. Su Ubuntu lancia, da riga di comando::

sudo apt-get install tk8.5-dev

o qualcosa di simile. Poi reinstalla l'interprete Python di Sage con::

sage -f python
make python3-clean python3-uninstall && make python3

Questo aggancerà automaticamente la libreria Tcl/Tk.
Dopo aver reinstallato correttamente l'interprete Python di Sage,
Expand Down
Loading