Import tkinter in Python2.7 on Mac

I recently installed Python2.7 on Mac OS 10.6.8. I have a problem with tkinter import. I save gettig this message "no matching architecture in universal wrapper", which means that the version of Tkinter is incorrect.

What I did, I followed the instructions here , downloaded ActiveTcl 8.5.11 for 32/64 bit MacOS architecure and installed it, but nothing really changed. I uninstalled and reinstalled the interpreter.

What should I do?

+4
source share
1 answer

You can install python which can support both 32bit and 64bit architecture from

http://python.org/download/releases/2.7.2/

Also after installing TCL from the mentioned link. You can try the following to check which architecture is suitable.

arch -i386 /path/to/python/executable from Tkinter import * 

or

 arch -x86_64 /path/to/python/executable from Tkinter import * 

This can help you solve the problem.

Note on the link: At the time of this writing, Mac OS X Python 3.2.x installers with 64-bit / 32-bit and 2.7.x 64-bit / 32-bit versions were built into Intel-64 (x86_64) and Intel Architecture -32 (i386) and the minimum deployment target for Mac OS X 10.6. The editions of Apple 8.5.9 and ActiveTcl 8.5.11 discussed below are compatible with these installers.

+2
source

Source: https://habr.com/ru/post/1387667/


All Articles