0

I asked this question https://stackoverflow.com/questions/49955313/toplevel-does-not-create-new-independent-windows-on-macos on Stack Overflow, thinking it was a Python programming problem.

Since then, a number of users have reported no issue, and I installed Python 3.6.5 on an old MacBook, running 10.12.6 and the code runs as expected.

Can anyone suggest why it does not work on my new iMac (Retina 4K, 21.5-inch, 2017) running 10.13.4 and more importantly what I can do to change this.

The program also fails to run correctly on a 2011 MacBook Pro running 10.13.3 under Python 3.6.4

The following show the display, and after resizing.

initial

resized

I can drag the 3 Toplevel() windows on screen, and they then display normally.

Running the program on Linux Python 3.5.3 shows:-

Linux


I upgraded to https://www.python.org/ftp/python/3.6.5/python-3.6.5-macosx10.9.pkg (which has an included version of Tcl/Tk 8.6) on both the 2011 MacBook Pro and iMac (Retina 4K, 21.5-inch, 2017) which both exhibited the same problem, so it would seem to be a problem with the Python interface to macOS 10.13

  • Where did you got Python 3.6.5? You may have the problems shown in this page. On my 2011 MBP, 10.13.4, with Anaconda Python, the program runs ok, four windows. – Yoan Apr 22 '18 at 14:42
1

I currently have the Anaconda version of Python 3.5.4 installed on 10.13.4 and python3 test.py at the shell prompt gave me the expected result.

I can only suggest that you have a broken tk/tcl install somewhere. This is probably due to the problems mentioned on this page. I would suggest uninstalling all versions of Python 3 and then installing either the Anaconda version or the Homebrew version. I prefer the Anaconda version as it allows me to easily install Jupyter and they look after these sort of compatibility problems well.

  • Thanks for the comment, but as I had stated "I upgraded to python.org/ftp/python/3.6.5/python-3.6.5-macosx10.9.pkg which has an included version of Tcl/Tk 8.6)", but the same installation on 10.12.6 works. The problem also occurred on 3.6.4 with the updated Tcl/Tk, as per the link. Also I do not want to use Anaconda, which has lots of included stuff that I don't want and will never use. The official download from the Python.org SHOULD work, and probably needs an update. – Milliways Apr 26 '18 at 7:36
  • When I first asked the question, I thought I was doing something wrong, but there is probably nothing I can do. Maybe Apple might finally get around to providing a current Python, before 2.7 becomes unsupported. – Milliways Apr 26 '18 at 7:36
0

You need to make sure which version you are running. Just type python on the command line, without a filename, and see what happens. Look at the output to see which version is running. If there is no output, it's probably a problem with your path. Type 'which python' on a terminal window and let me know what prints.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .