This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 156970 - Unable to set python command for mac for tkinter
Summary: Unable to set python command for mac for tkinter
Status: STARTED
Alias: None
Product: python
Classification: Unclassified
Component: Platform (show other bugs)
Version: 6.x
Hardware: All Mac OS X
: P2 blocker (vote)
Assignee: juniel_katarn
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-16 18:41 UTC by tonybeckham
Modified: 2015-08-24 20:11 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tonybeckham 2009-01-16 18:41:51 UTC
To use tkinter on Mac you must use the binary pythonw.  If you use the platform manager to browse to this binary
(/System/Library/Frameworks/Python.framework/Versions/2.5/bin/pythonw) and select it, the command is set as
/System/Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python

To fix this you must manually enter the path into the command field (same for console command)
Comment 1 Lou Dasaro 2015-08-18 17:01:21 UTC
Julio, please review and comment. Thank you.
Comment 2 juniel_katarn 2015-08-19 08:37:47 UTC
Greetings.
Work has been done on the platform manager since this bug was reported.

Well try to reproduce and provide feedback.
Comment 3 juniel_katarn 2015-08-20 06:15:18 UTC
I have confirmed this behavior on the latest development snapshot.
After browsing the source code, it's clear that the Platform detector doesn't consider pythonw as a useable Python executable, therefore, it looks for python or python.exe.
Comment 4 juniel_katarn 2015-08-22 08:30:47 UTC
Steps to reproduce (Mac OS X 10.9)
1. Open Tools -> Python Platforms.
2. Click on 'New'.
3. Browse to /System/Library/Frameworks/Python.framework/Versions/2.7/bin/
4. Select the executable 'pythonw'

This will be the result configuration for the newly set platform:
Platform Name: Python 2.7.5
Command: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Console Command: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Command Arguments: -u

This issue seems to be exclusive to Python 2.7 .
Following the same process for version 2.6 does not trigger the bug.
Comment 5 Lou Dasaro 2015-08-22 17:33:31 UTC
Autodetect does not look for Pythonw, which I do not consider a bug.
Using Python Platform Manager on Windows, I can browse to the Python platform and select "Pythonw" and it seems to generate default Python path just fine. I can use it with projects edit/run/debug and/or make it the default Python platform with no troubles. I stepped through the code and it does appear to be working with "pythonw".

What is the nature of the bug on Mac? Is it just lacking Autodetect functionality, or is it accepting "pythonw" but using "python" instead?
Comment 6 juniel_katarn 2015-08-24 07:40:46 UTC
(In reply to Lou Dasaro from comment #5)
> Autodetect does not look for Pythonw, which I do not consider a bug.
> Using Python Platform Manager on Windows, I can browse to the Python
> platform and select "Pythonw" and it seems to generate default Python path
> just fine. I can use it with projects edit/run/debug and/or make it the
> default Python platform with no troubles. I stepped through the code and it
> does appear to be working with "pythonw".
> 
> What is the nature of the bug on Mac? Is it just lacking Autodetect
> functionality, or is it accepting "pythonw" but using "python" instead?

It's the second case. It accepts 'pythonw', but just uses 'Python', from a seemingly different location (see steps to reproduce).
I'm still tracking where does this value get overridden.

Moreover, in 10.9, it only does that for version 2.7. 2.6 or 2.5 can choose 'pythonw' without issues.

I suspect this will be an issue with any default Python platform instance for Mac OS X, whatever the version.
Comment 7 Lou Dasaro 2015-08-24 20:11:20 UTC
#Python test code for #156970:
import sys
if __name__ == "__main__":
    print "version= " + sys.version 
    print "executable= " + sys.executable