Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

macmesser

macrumors 6502a
Original poster
Aug 13, 2012
921
198
Long Island, NY USA
I just bought the new programming course from The Teaching Company and am setting up to play with Python. It looks to be a painless way to learn Python and review familiar programming concepts. Fun stuff for me but, with non-existant to minimal unix skills, I need some help getting started.

I am running 10.11.6 on CMP 5,1 and just installed Python 3.5.2 64 bit (python-3.5.3-macos10.6.pkg). Per Python.org recommendation I also installed Tcl/Tk from ActiveState (ActiveTcl8.6.4.1.299124-macosx10.5-i386-x86_64-threaded.dmg). The information I was going on is here at:

https://www.python.org/download/mac/tcltk/

I first installed Python 3.5.2 and then the Tcl/Tk package, but after re-reading the above linked page I am wondering if the installation order is critical and should have been reversed. The excerpt below (specifically the parts I highlighted in red) is what gave me pause. My concern is that the Python installer could have linked Python to the pre-existing Tcl/Tk (I think Apple 8.5.9) rather than the recommended version from ActiveState. Do the Apple native and the ActiveState Tcl/Tk frameworks now coexist on my system in different locations, and is the behavior of the dynamic linker determined only at run time, or does it point to the Tcl/Tk framework to be used when Python is installed?

------------------------python.org excerpt begins---------------------

How Python Chooses Which Tk Library To Use
Note

While Tcl and Tk are separate frameworks and libraries, they are closely related and are normally installed or updated simultaneously. You should not attempt to mix-and-match Tcl and Tk versions. References to a specific version of Tk assume the corresponding version of Tcl is installed as well.

The Python for Mac OS X installers downloaded from this website dynamically link at runtime to Tcl/Tk Mac OS X frameworks. The Tcl/Tk major version is determined when the installer is created and cannot be overridden. The Python 64-bit/32-bit Mac OS X installers for Python 3.5.x, 3.4.x, 3.3.x, 3.2.x, and 2.7.x dynamically link to Tcl/Tk 8.5 frameworks. 32-bit-only Python installers for Mac OS X dynamically link to Tcl/Tk 8.4 frameworks.

In either case, the dynamically linking occurs when tkinter (Python 3) or Tkinter (Python 2) is first imported (specifically, the internal _tkinter C extension module). By default, the Mac OS X dynamic linker looks first in /Library/Frameworks for Tcl and Tk frameworks with the proper major version. This is the standard location for third-party or built from source frameworks, including the ActiveTcl releases. If frameworks of the proper major version are not found there, the dynamic linker looks for the same version in /System/Library/Frameworks, the location for Apple-supplied frameworks shipped with Mac OS X. (Note, you should normally not modify or delete files in /System/Library.)

------------------------python.org excerpt ends-----------------------
[doublepost=1474021004][/doublepost]Seems like my concerns are real, so I now need get Python to use the recommended version. I just tested the installation by opening IDLE and, although able to print a line, it gave the following message immediately:

---------IDLE message begins----------
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 26 2016, 10:47:25)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable.
Visit http://www.python.org/download/mac/tcltk/ for current information.
print ("oi, veh!")
oi, veh!
>>>
---------IDLE message ends-----------

Interestingly, the Tcl/Tk (8.5.9) that was the subject of the warning IS, as far as I can tell, the Apple-supplied standard OS equipment. Could the problem be with the Python installation? Thanks in advance for any help.
 

macmesser

macrumors 6502a
Original poster
Aug 13, 2012
921
198
Long Island, NY USA
You need Tcl/Tk 8.5, unfortunately. Python for Mac won't link against 8.6.
Thanks or reply. Hmm. It seemed to be the recommended package at Python.org. Didn't realize I was that confused. So apparently what happened is that Python linked with the version it could link with, which was the Apple-installed 8.5.9. I think it was ActiveState also (?) but may be wrong on that. This raises the question as to why I got the "may be unstable" warning message after linking with 8.5.9. No place higher to go in the 8.5.x's. Doesn't seem as if I should need an older version than the OS standard for Python 3.5.2.
[doublepost=1474287404][/doublepost]BTW, there is more on this issue on the Apple support forum, here: https://discussions.apple.com/thread/7670778
[doublepost=1474287641][/doublepost]
Thanks or reply. Hmm. It seemed to be the recommended package at Python.org. Didn't realize I was that confused. So apparently what happened is that Python linked with the version it could link with, which was the Apple-installed 8.5.9. I think it was ActiveState also (?) but may be wrong on that. This raises the question as to why I got the "may be unstable" warning message after linking with 8.5.9. No place higher to go in the 8.5.x's. Doesn't seem as if I should need an older version than the OS standard for Python 3.5.2.
[doublepost=1474287404][/doublepost]BTW, there is more on this issue on the Apple support forum, here: https://discussions.apple.com/thread/7670778

What version 8.5.x Tcl/Tk should I install and will it coexist as an independent framework with any other versions installed? There are two already on my system.
 
Last edited:

macmesser

macrumors 6502a
Original poster
Aug 13, 2012
921
198
Long Island, NY USA
Thanks for reply. I'll check it out. Should installing 8.5.18.1 just fix things or will I need to uninstall and reinstall Tcl/Tk and/or Python? Does Tcl/Tk need to be installed before Python?
 

macmesser

macrumors 6502a
Original poster
Aug 13, 2012
921
198
Long Island, NY USA
Installing 8.5.18.1 will fix this.

Thanks again. Not to belabor this, but I still have a few basic questions which will help me understand what's at play.

Will installing Tcl/Tk 8.5.18.1 fix it because the Python in my 3.5.2 installer from python.org has been compiled to link it? (I intend to just run the Tcl/Tk package installer over what I have now, which is OS standard Python/Tcl/Tk software plus Python 3.5.2 and Tcl/Tk 8.6.4.1 - is this OK?)

Will running different version installers for Python and Tcl/Tk in general produce independent version installations or is there a possibility of a new one stepping on the toes of a previous installation, resulting in one or both being broken?
 

wrldwzrd89

macrumors G5
Jun 6, 2003
12,110
77
Solon, OH
Thanks again. Not to belabor this, but I still have a few basic questions which will help me understand what's at play.

Will installing Tcl/Tk 8.5.18.1 fix it because the Python in my 3.5.2 installer from python.org has been compiled to link it? (I intend to just run the Tcl/Tk package installer over what I have now, which is OS standard Python/Tcl/Tk software plus Python 3.5.2 and Tcl/Tk 8.6.4.1 - is this OK?)

Will running different version installers for Python and Tcl/Tk in general produce independent version installations or is there a possibility of a new one stepping on the toes of a previous installation, resulting in one or both being broken?
First question about linking: Yes. Python 3.x for Mac only links against Tcl/Tk 8.5, NOT 8.6.

Second and third questions: I've never tested this scenario before. I believe they will all function independently, since they install themselves to different places on disk. So you should be good to go.
 
  • Like
Reactions: macmesser

macmesser

macrumors 6502a
Original poster
Aug 13, 2012
921
198
Long Island, NY USA
First question about linking: Yes. Python 3.x for Mac only links against Tcl/Tk 8.5, NOT 8.6.

Second and third questions: I've never tested this scenario before. I believe they will all function independently, since they install themselves to different places on disk. So you should be good to go.

Success. I installed the 8.5 option available (listed after 8.6) at activestate.com. The current download file is ActiveTcl8.5.18.0.298892-macosx10.5-i386-x86_64-threaded.dmg so seems it may not be quite 8.5.18.1 , unless there is a small inconsistency in the name of the dmg file. The important thing is that it works without throwing an alert in idle. Thanks for bearing with me.
 

wrldwzrd89

macrumors G5
Jun 6, 2003
12,110
77
Solon, OH
Success. I installed the 8.5 option available (listed after 8.6) at activestate.com. The current download file is ActiveTcl8.5.18.0.298892-macosx10.5-i386-x86_64-threaded.dmg so seems it may not be quite 8.5.18.1 , unless there is a small inconsistency in the name of the dmg file. The important thing is that it works without throwing an alert in idle. Thanks for bearing with me.
You've got the right one now. I may have misspoke about Tcl 8.5.18 exact version.
 
  • Like
Reactions: macmesser
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.