Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build Python3 WITHOUT support for tk?

Basically I want to build a minimal version of Python 3 (this will be running on a headless server, so no GUI, no mouse, no keyboard). The dependency on tk for most Python packages pulls in X and bunch of other UI things I dont want.

There's nothing in ./configure --help that tells me how to switch off building with tk. And nothing in the README file included with the source tarball either. Its been surprisingly hard to find info about this, so what kind of spell is needed ?

like image 977
Eno Avatar asked Dec 12 '14 22:12

Eno


People also ask

Does Python 3.6 have tkinter?

25.1. tkinter — Python interface to Tcl/Tk — Python 3.6.

What is Tk () in tkinter Python?

Tkinter is a Python package which comes with many functions and methods that can be used to create an application. In order to create a tkinter application, we generally create an instance of tkinter frame, i.e., Tk(). It helps to display the root window and manages all the other components of the tkinter application.

How do I get tkinter in Python?

Python Distributions with Tkinter The simplest method to install Tkinter in a Windows environment is to download and install either ActivePython 3.8 or 3.7 from here. Alternatively, you can create and activate a Conda environment with Python 3.7 or greater that is integrated with the latest version of Tkinter.


1 Answers

If the server you are trying to build Python on does not have tcl/tk installed, then Python will skip that portion during its build process.

like image 128
Ethan Furman Avatar answered Oct 04 '22 07:10

Ethan Furman