help! - Python, Tkinter and IDLE

ugajin at talktalk.net ugajin at talktalk.net
Fri Apr 4 03:17:40 PDT 2014


Hi

This is a follow up, I had originally posted in regard to problems running the Tkinter libraries on a Macports installed version of Python. As a short term solution I reverted back to the OSX Python version, and I am now in the merde. 

Recently Ryan, wrote:

"Software installed in /usr/local or /Library/Frameworks often causes problems for MacPorts-installed software. You should use MacPorts, or manually-installed software in those locations, not both together; to avoid problems, please uninstall the one you don’t want to use."
 
This is a bit unclear as there are several Library locations, and because Python on OSX v10.6.8 is located here: /System/Library/Frameworks/Python.framework/Versions/. . . and I have nothing in /usr/local. In addition, the Macports Python installed here: /opt/local/Library/Frameworks/Python.framework/Versions/. . .

I almost spoke to soon, when I was about to say: 'I am able to run either versions quite happily, and do not run the two versions at the same time'. I can continue to run either Python version happily but with a few exceptions. I still can't run IDLE with the macports version of Python (I have not yet ported Tcl/tk), but it did run with the OSX python version, until now that is. 

Thinking about your advice, I pondered whether this is the cause of a problem that I am now experiencing, and I looked at un-installing the macports version, but I have been unable to proceed with this. I am unable to uninstall python27 @2.7.6_0 primarily because I want to retain Fontforge which depends on it. I guess I could try uninstalling Fontforge and dependencies, but this would leave me without Fontforge and it may not resolve the current IDLE issue for OSX Python. Another, possible solution is to port Tcl/Tk and re-activate the port Python as default, but I am not confident this will not also inherit the current problem that I am experiencing with IDLE, and I would like to resolve this issue in the first instance.

I have attached a screen grab of the alert message which now appears when I try to run IDLE from OSX Python. The message box is itself frozen, and the OK button unresponsive. Eventually a shape the size of the IDLE window appears on screen as a blank white square, and I have to force quit, to quit the python launcher. 
In addition, this is the console message that appears in Terminal:
Apples-iMac-4:scripts apple$ IDLE
11:20:00
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/idlelib/run.py", line 7, in <module>
    import threading
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/threading.py", line 14, in <module>
    from time import time as _time, sleep as _sleep
ImportError: cannot import name sleep

The console message has identical content to a message that I am also currently investigating, and which had caused me to try to launch IDLE at this time. This problem relates to running Python scripts that have import commands to a particular 3rd party library, which were working, but now no longer work without generating the same console message. Other scripts seem to run OK on both OSX Python and the macported Python. I would say the problem is with the 3rd party library save that IDLE is not related to that library.

This may or may not be a macport issue, but as you say, having both macported and OSX versions of Python may be causing a conflict. Please explain how I may follow your initial advise on removing manually-installed software it may help.

Thank you for reading and considering matters. 

-A

 

 

-----Original Message-----
From: Ryan Schmidt <ryandesign at macports.org>
To: ugajin at talktalk.net
CC: MacPorts Users <macports-users at lists.macosforge.org>
Sent: Wed, 2 Apr 2014 3:40
Subject: Re: Python and Tkinter



On Apr 1, 2014, at 19:15, ugajin at talktalk.net wrote:

> I run OSX v10.6.8 (Snow Leopard) and I have a few versions of Python 
installed. The latest version is 2.7.6 installed itself along with (I beleive) a 
Macport installation of Fontforge. Being a Macport installation it is not 
located in the usual System > Library > . . . location. Nonetheless, if I run 
Terminal in interactive Python mode, this is the (default) version launched.

Presumably because at some time you requested for that to happen, by running:

sudo port select python python27

If you want to return to the OS X version of python being default, you would 
run:

sudo port select python none


> I do not seem to be able to launch IDLE, but more importantly to me, is that I 
wish to install TKinter. I have downloaded the installer from ActiveState but I 
have not run it (at the time of writing). This is what the Read Me file states:
> 	• ActiveTcl 8.5.15.1.297588 installs
> 		• Tcl as a framework in "/Library/Frameworks/Tcl.framework/Versions/8.5".
> 		• Tk as a framework in "/Library/Frameworks/Tk.framework/Versions/8.5".
> 		• the packages in "/Library/Tcl/".
> 	• Symbolic links and stubs are created in "/usr/local/bin" for launching 
tclsh, and wish from the command line.
> 	• Symbolic links are created in "/Applications/Utilities" for launching wish 
from the Finder, Panel, etc.
> 	• The ActiveTcl documentation is installed in the Tcl framework, but a 
symbolic link is created in "/Library/Documentation/Help/ActiveTcl-8.5" to them.
> The question is; should I proceed with the ActiveState installation, or is 
their a better alternative Port option? 
> 
> I am concerned that the location of Python v2.7.6 which is located in 
/opt/local/Library/Frameworks/Python.framework/Versions/2.7 may be on issue.

Software installed in /usr/local or /Library/Frameworks often causes problems 
for MacPorts-installed software. You should use MacPorts, or manually-installed 
software in those locations, not both together; to avoid problems, please 
uninstall the one you don’t want to use.

If you want to stick with MacPorts, then IDLE is already included with the 
python27 port, and tkinter is in the py27-tkinter port. If they don’t work, 
please report the bugs to us.


 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-users/attachments/20140404/e5be118e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: subprocess.png
Type: image/png
Size: 41364 bytes
Desc: not available
URL: <https://lists.macosforge.org/pipermail/macports-users/attachments/20140404/e5be118e/attachment.png>


More information about the macports-users mailing list