[MacPorts] #25221: "import Tkinter" fails in python26 @2.6.5_1 with 64-bit tk @8.5.8+quartz
#25221: "import Tkinter" fails in python26 @2.6.5_1 with 64-bit tk @8.5.8+quartz ---------------------------------+------------------------------------------ Reporter: jabronson@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.0 Keywords: | Port: python26 ---------------------------------+------------------------------------------ A few months ago I built 64-bit Macports tk +quartz (using the [attachment:tk-858-decarbon.patch:ticket:20799 fix] from #20799), after which I was able to use the Tkinter module of Macports python26 (then @2.6.4) to create native Aqua windows. I just tried "import Tkinter" for the first time in a while and now I get: {{{ Python 2.6.5 (r265:79063, Jun 12 2010, 12:43:44) [GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import Tkinter Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6 /lib-tk/Tkinter.py", line 39, in <module> import _tkinter # If this fails your Python may not be configured for Tk ImportError: No module named _tkinter }}}
As you can see, I've since upgraded to Python 2.6.5. I just tried building Macports Python 2.6.5 again and sure enough, I noticed this output: {{{ ... building '_tkinter' extension /usr/bin/gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DWITH_APPINIT=1 -I. -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python26/work/Python-2.6.5/./Include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python26/work/Python-2.6.5/./Mac/Include -I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include -I. -IInclude -I./Include -I/opt/local/include -I/opt/local/include/ncurses -I/usr/local/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python26/work/Python-2.6.5/Include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python26/work/Python-2.6.5 -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python26/work/Python-2.6.5/Modules/_tkinter.c -o build/temp.macosx-10.6-x86_64-2.6/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python26/work/Python-2.6.5/Modules/_tkinter.o /usr/bin/gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DWITH_APPINIT=1 -I. -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python26/work/Python-2.6.5/./Include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python26/work/Python-2.6.5/./Mac/Include -I/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include -I. -IInclude -I./Include -I/opt/local/include -I/opt/local/include/ncurses -I/usr/local/include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python26/work/Python-2.6.5/Include -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python26/work/Python-2.6.5 -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python26/work/Python-2.6.5/Modules/tkappinit.c -o build/temp.macosx-10.6-x86_64-2.6/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python26/work/Python-2.6.5/Modules/tkappinit.o /usr/bin/gcc-4.2 -L/opt/local/lib -arch x86_64 -bundle -undefined dynamic_lookup build/temp.macosx-10.6-x86_64-2.6/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python26/work/Python-2.6.5/Modules/_tkinter.o build/temp.macosx-10.6-x86_64-2.6/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_lang_python26/work/Python-2.6.5/Modules/tkappinit.o -L/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib -L/opt/local/lib -L/usr/local/lib -ltk8.5 -ltcl8.5 -lX11 -o build/lib.macosx-10.6-x86_64-2.6/_tkinter.so ld: library not found for -lX11 collect2: ld returned 1 exit status ... Failed to build these modules: _tkinter ... }}} It looks like it's mistakenly passing "-lX11" when it's trying to build _tkinter.so. Am I correct in suspecting that since my tk is built with +quartz, libX11 should not be involved in building _tkinter? Is there a way to fix this? I'm running Macports 1.9.0 and OS X 10.6.3. Thanks! Josh -- Ticket URL: <http://trac.macports.org/ticket/25221> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25221: "import Tkinter" fails in python26 @2.6.5_1 with 64-bit tk @8.5.8+quartz ---------------------------------+------------------------------------------ Reporter: jabronson@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.0 Keywords: | Port: python26 ---------------------------------+------------------------------------------ Comment(by jmr@…): Why do you think this is a bug in python26 and not in your modified tk port? -- Ticket URL: <http://trac.macports.org/ticket/25221#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25221: "import Tkinter" fails in python26 @2.6.5_1 with 64-bit tk @8.5.8+quartz ---------------------------------+------------------------------------------ Reporter: jabronson@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.0 Keywords: | Port: python26 ---------------------------------+------------------------------------------ Comment(by jabronson@…): Replying to [comment:1 jmr@…]:
Why do you think this is a bug in python26 and not in your modified tk port? I gave all the information I have. Feel free to correct anything that may be incorrect.
-- Ticket URL: <http://trac.macports.org/ticket/25221#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25221: "import Tkinter" fails in python26 @2.6.5_1 with 64-bit tk @8.5.8+quartz ---------------------------------+------------------------------------------ Reporter: jabronson@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.0 Keywords: | Port: python26 python27 python31 ---------------------------------+------------------------------------------ Changes (by blb@…): * cc: mww@… (removed) * cc: jwa@…, erickt@… (added) * port: python26 => python26 python27 python31 Comment: Fixed in r68792; however you're going to run into #22954 since the tcl port does not currently link to CoreFoundation. Cc'ing 2.7 and 3.1 maintainers as this is probably needed for those as well. -- Ticket URL: <http://trac.macports.org/ticket/25221#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25221: "import Tkinter" fails in python26 @2.6.5_1 with 64-bit tk @8.5.8+quartz ---------------------------------+------------------------------------------ Reporter: jabronson@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.0 Keywords: | Port: python26 python27 python31 ---------------------------------+------------------------------------------ Comment(by jabronson@…): Rebuilt tcl with the patch from #22954 and then rebuilt python26 from svn and Tkinter now works like a charm, thanks!!! -- Ticket URL: <http://trac.macports.org/ticket/25221#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25221: "import Tkinter" fails in python26 @2.6.5_1 with 64-bit tk @8.5.8+quartz ---------------------------------+------------------------------------------ Reporter: jabronson@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.0 Keywords: | Port: python26 python27 python31 ---------------------------------+------------------------------------------ Changes (by ryandesign@…): * cc: ryandesign@… (added) Comment: Replying to [comment:3 blb@…]:
Fixed in r68792
On my Leopard ppc machine with MP 1.9.0 I now get: {{{ $ port -u upgrade python26 ---> Computing dependencies for python26 ---> Fetching python26 ---> Verifying checksum(s) for python26 ---> Extracting python26 ---> Applying patches to python26 Error: Target org.macports.patch returned: wrong # args: should be "catch command ?varName?" Log for python26 is at: /mp/var/macports/logs/_Volumes_data_macports_ports_lang_python26/main.log Error: Unable to upgrade port: 1 }}} AFAICT this "options" parameter you're using was only added in TCL 8.5; Leopard has TCL 8.4. -- Ticket URL: <http://trac.macports.org/ticket/25221#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#25221: "import Tkinter" fails in python26 @2.6.5_1 with 64-bit tk @8.5.8+quartz ---------------------------------+------------------------------------------ Reporter: jabronson@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.0 Keywords: | Port: python26 python27 python31 ---------------------------------+------------------------------------------ Comment(by blb@…): Replying to [comment:5 ryandesign@…]:
AFAICT this "options" parameter you're using was only added in TCL 8.5; Leopard has TCL 8.4.
Oops, that is right; fortunately I wasn't using either variable in the catch anyway, so it should work on older Tcl as of r68800. -- Ticket URL: <http://trac.macports.org/ticket/25221#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts