This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Mac OS X: building with X11 Tkinter
Type: enhancement Stage: resolved
Components: Build, Tkinter Versions: Python 3.3, Python 3.4, Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ned.deily Nosy List: asvetlov, ceball, christian.heimes, georg.brandl, ned.deily, python-dev, ronaldoussoren, samueljohn
Priority: normal Keywords: patch

Created on 2007-12-11 04:04 by ceball, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
issue1584_rev0.patch ned.deily, 2013-09-05 09:37 review
Messages (16)
msg58413 - (view) Author: C. E. Ball (ceball) Date: 2007-12-11 04:04
On OS X, I wanted to build my own copy of Python that used my own copy
of Tkinter (built for X11). 

To do this, I passed "LDFLAGS=-rpath,/path/to/lib" to configure so that
Python could find my specific lib files, but I also had to edit Python's so that detect_tkinter() would not do anything special for Darwin:

$ diff 
<         if 0 and (platform == 'darwin' and
>         if (platform == 'darwin' and

I did this based on a post by Ronald Oussoren to the Python-SIG Mac
mailing list [].
He also suggested that I file a bug report, asking for an argument to be
added to python's configure script to avoid having to edit

msg58421 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-12-11 09:04
The problem is already fixed in svn. Can you download a svn checkout and
verify it that the code is working?

41848 skip.montanaro         if (platform == 'darwin' and
msg58439 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-12-11 16:28
Crys: look closely at the diff, the "0 and " is in the modified file.
msg58479 - (view) Author: C. E. Ball (ceball) Date: 2007-12-12 00:11
I apologize for the confusion: I put the modified file first and the
original second.

Sorry about that!

An option to do nothing special to find Tk and Tcl on darwin is what
would be useful.
msg84476 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-03-30 03:19
Reopening since additional feedback was provided clarifying the request.

How does this request interact with the business about building the Mac
installer with a local tk installed?  Does the fact that that does
something useful mean that this request is in fact out of date?  Looking
at the comments, I suspect not.
msg84562 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2009-03-30 15:15
Adding support for building an X11 version of Tkinter would require an 
explicit flag to configure, defaulting to a build that uses AquaTk (which 
most people would like to use).

I'm not interested in creating a patch for this, but am willing to review 
patches for this.
msg116800 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-09-18 15:33
This will go nowhere unless someone supplies a patch.
msg116922 - (view) Author: C. E. Ball (ceball) Date: 2010-09-20 09:47
Sorry, I don't have a Mac, and I don't have access to one that I could use to make a patch. 

At the time, I was trying to support OS X users of a piece of Python/Tkinter software. Please do not keep this issue open on my account.

msg157438 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2012-04-03 18:52
Is there actual?
msg157441 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2012-04-03 20:03
It certainly is still possible to patch current Pythons to build with the X11 Tk 8.5 on OS X.  For example, the current MacPorts Python ports use an X11 Tk 8.5.  Considering all the issues that have arisen with the other Tcl/Tk implementations on OS X (i.e. Cocoa Tk and Carbon Tk), I think it would be useful to provide better support for choosing which to build with.  I'll take a look at this as a possible feature.
msg157442 - (view) Author: Andrew Svetlov (asvetlov) * (Python committer) Date: 2012-04-03 20:04
Thank you, Ned.
msg178933 - (view) Author: Samuel John (samueljohn) Date: 2013-01-03 11:04
Hello from Homebrew (Mac)!

Indeed we also patch (but right now only for python2.7) and uncommented the "detect_tkinter_darwin" related lines to support linking against a Tkinter build with homebrew (optionally with X11 support).

(Our patch:

I agree that an option to tell to use another Tk would be much appreciated.
msg196987 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2013-09-05 09:37
Here's a patch. It is simple-minded but I think it should be powerful enough for advanced users to build with non-default Tcl and Tk libraries without having to modify the source.  It adds two new options to configure; if used, both must be specified:

  ./configure \
      --with-tcltk-includes="-I/opt/local/include" \
      --with-tcltk-libs="-L/opt/local/lib -ltcl8.5 -ltk8.5"

The values are passed into the top-level and override the default searches and values for include_dirs and libraries when building

In addition, the options can be overridden with make.  This can be useful when testing tkinter with different versions of Tcl/Tk:

   make test  # test with platform default Tcl/Tk
   ( cd ./build/lib.xx && mv )
   make \
       TCLTK_INCLUDES="-I/opt/local/include" \
       TCLTK_LIBS="-L/opt/local/lib -ltcl8.6 -ltk8.6"
   make test  # test with another version of Tcl/Tk

I have some more testing to do on other platforms but, unless there are major objections, I intend to commit this soon for use with Issue15663.
msg197054 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-09-06 08:08
New changeset 0986e4f5750d by Ned Deily in branch 'default':
Issue #1584: Provide options to override default search paths for Tcl and Tk
msg201221 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-10-25 07:54
New changeset e7474d4d85ca by Ned Deily in branch '2.7':
Issue #1584: Provide options to override default search paths for Tcl and Tk

New changeset d7662958b27a by Ned Deily in branch '3.3':
Issue #1584: Provide options to override default search paths for Tcl and Tk
msg201222 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2013-10-25 07:59
Committed to default for release in 3.4.0.  With the consent of the release managers, this change has been backported to 2.7 (for release in 2.7.6) and 3.3 (for 3.3.3) in support of Issue15663.
Date User Action Args
2022-04-11 14:56:28adminsetgithub: 45925
2013-11-12 08:05:23ned.deilylinkissue1109602 superseder
2013-10-25 07:59:53ned.deilysetstatus: open -> closed
versions: + Python 2.7, Python 3.3
messages: + msg201222

resolution: fixed
stage: patch review -> resolved
2013-10-25 07:54:06python-devsetmessages: + msg201221
2013-09-06 08:36:11ned.deilylinkissue15663 dependencies
2013-09-06 08:08:09python-devsetnosy: + python-dev
messages: + msg197054
2013-09-05 09:37:10ned.deilysetfiles: + issue1584_rev0.patch
messages: + msg196987

components: - macOS
keywords: + patch
stage: needs patch -> patch review
2013-03-13 20:40:02ezio.melottisetversions: + Python 3.4, - Python 3.3
2013-01-03 11:04:12samueljohnsetnosy: + samueljohn
messages: + msg178933
2012-04-03 20:04:43asvetlovsetmessages: + msg157442
2012-04-03 20:03:02ned.deilysetassignee: ned.deily
messages: + msg157441
nosy: + ned.deily, - BreamoreBoy
2012-04-03 18:52:52asvetlovsetnosy: + asvetlov

messages: + msg157438
versions: + Python 3.3, - Python 3.2
2010-09-20 09:47:13ceballsetnosy: georg.brandl, ronaldoussoren, christian.heimes, ceball, BreamoreBoy
messages: + msg116922
2010-09-18 15:33:57BreamoreBoysetnosy: + BreamoreBoy

messages: + msg116800
versions: + Python 3.2, - Python 3.1, Python 2.7
2009-09-06 21:20:55ronaldoussorensetstage: needs patch
2009-05-12 02:09:59r.david.murraysetnosy: - r.david.murray
2009-03-30 15:15:22ronaldoussorensetnosy: + ronaldoussoren
messages: + msg84562
2009-03-30 03:19:56r.david.murraysetstatus: pending -> open

type: behavior -> enhancement
versions: + Python 3.1, Python 2.7, - Python 2.5
nosy: + r.david.murray

messages: + msg84476
resolution: out of date -> (no value)
2007-12-12 00:11:44ceballsetmessages: + msg58479
2007-12-11 16:28:32georg.brandlsetnosy: + georg.brandl
messages: + msg58439
2007-12-11 09:04:21christian.heimessetstatus: open -> pending
priority: normal
resolution: out of date
messages: + msg58421
nosy: + christian.heimes
2007-12-11 04:04:58ceballcreate