ContinuumIO / anaconda-issues

Anaconda issue tracking
646 stars 220 forks source link

Tkinter code running on Anaconda Build of Python on macOS 10.14.6 crashes the windowing system #11165

Open tazzben opened 5 years ago

tazzben commented 5 years ago

Consider the simple hello world on this page:

https://docs.python.org/3/library/tkinter.html

When run on macOS 10.14.6 with Anaconda 2019.7, the entire windowing system crashes (knocking the user back to the window login). I've tested this on three different machines and they exhibit the same behavior (some machines have anaconda installed for all users, some just the signed in user).

It seems to be specific to the installation of Anaconda: I've created a virtual machine running 10.14.6 containing only Python 3.7.4 (installed from python.org) and the code works as expected. However, one of the more interesting aspects of this bug is that Anaconda only needs to be installed to have the problem. If you execute the code using the standard python build, but anaconda is installed, it still crashes.

I suspect this problem relates to how anaconda installs TK/TCL packages. Something that changed in macOS 10.14.6 resulted in some kind of conflict (as it didn't crash in macOS 10.14.5).

conda info
active environment : base active env location : //anaconda3 shell level : 1 user config file : /Users/ben/.condarc populated config files : /Users/ben/.condarc conda version : 4.7.10 conda-build version : 3.18.8 python version : 3.7.3.final.0 virtual packages : base environment : //anaconda3 (writable) channel URLs : https://repo.anaconda.com/pkgs/main/osx-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/r/osx-64 https://repo.anaconda.com/pkgs/r/noarch package cache : //anaconda3/pkgs /Users/ben/.conda/pkgs envs directories : //anaconda3/envs /Users/ben/.conda/envs platform : osx-64 user-agent : conda/4.7.10 requests/2.22.0 CPython/3.7.3 Darwin/18.7.0 OSX/10.14.6 UID:GID : 501:20 netrc file : None offline mode : False
conda list --show-channel-urls
``` # packages in environment at //anaconda3: # # Name Version Build Channel _ipyw_jlab_nb_ext_conf 0.1.0 py37_0 defaults alabaster 0.7.12 py37_0 defaults anaconda 2019.07 py37_0 defaults anaconda-client 1.7.2 py37_0 defaults anaconda-navigator 1.9.7 py37_0 defaults anaconda-project 0.8.3 py_0 defaults appnope 0.1.0 py37_0 defaults appscript 1.1.0 py37h1de35cc_0 defaults asn1crypto 0.24.0 py37_0 defaults astroid 2.2.5 py37_0 defaults astropy 3.2.1 py37h1de35cc_0 defaults atomicwrites 1.3.0 py37_1 defaults attrs 19.1.0 py37_1 defaults babel 2.7.0 py_0 defaults backcall 0.1.0 py37_0 defaults backports 1.0 py_2 defaults backports.functools_lru_cache 1.5 py_2 defaults backports.os 0.1.1 py37_0 defaults backports.shutil_get_terminal_size 1.0.0 py37_2 defaults backports.tempfile 1.0 py_1 defaults backports.weakref 1.0.post1 py_1 defaults beautifulsoup4 4.7.1 py37_1 defaults bitarray 0.9.3 py37h1de35cc_0 defaults bkcharts 0.2 py37_0 defaults blas 1.0 mkl defaults bleach 3.1.0 py37_0 defaults blosc 1.16.3 hd9629dc_0 defaults bokeh 1.2.0 py37_0 defaults boto 2.49.0 py37_0 defaults bottleneck 1.2.1 py37h1d22016_1 defaults bzip2 1.0.8 h1de35cc_0 defaults ca-certificates 2019.5.15 0 defaults certifi 2019.6.16 py37_0 defaults cffi 1.12.3 py37hb5b8e2f_0 defaults chardet 3.0.4 py37_1 defaults click 7.0 py37_0 defaults cloudpickle 1.2.1 py_0 defaults clyent 1.2.2 py37_1 defaults colorama 0.4.1 py37_0 defaults conda 4.7.10 py37_0 defaults conda-build 3.18.8 py37_0 defaults conda-env 2.6.0 1 defaults conda-package-handling 1.3.11 py37_0 defaults conda-verify 3.4.2 py_1 defaults contextlib2 0.5.5 py37_0 defaults cryptography 2.7 py37ha12b0ac_0 defaults curl 7.65.2 ha441bb4_0 defaults cycler 0.10.0 py37_0 defaults cython 0.29.12 py37h0a44026_0 defaults cytoolz 0.10.0 py37h1de35cc_0 defaults dask 2.1.0 py_0 defaults dask-core 2.1.0 py_0 defaults dbus 1.13.6 h90a0687_0 defaults decorator 4.4.0 py37_1 defaults defusedxml 0.6.0 py_0 defaults distributed 2.1.0 py_0 defaults docutils 0.14 py37_0 defaults entrypoints 0.3 py37_0 defaults et_xmlfile 1.0.1 py37_0 defaults expat 2.2.6 h0a44026_0 defaults fastcache 1.1.0 py37h1de35cc_0 defaults filelock 3.0.12 py_0 defaults flask 1.1.1 py_0 defaults freetype 2.9.1 hb4e5f40_0 defaults future 0.17.1 py37_0 defaults get_terminal_size 1.0.0 h7520d66_0 defaults gettext 0.19.8.1 h15daf44_3 defaults gevent 1.4.0 py37h1de35cc_0 defaults glib 2.56.2 hd9629dc_0 defaults glob2 0.7 py_0 defaults gmp 6.1.2 hb37e062_1 defaults gmpy2 2.0.8 py37h6ef4df4_2 defaults greenlet 0.4.15 py37h1de35cc_0 defaults h5py 2.9.0 py37h3134771_0 defaults hdf5 1.10.4 hfa1e0ec_0 defaults heapdict 1.0.0 py37_2 defaults html5lib 1.0.1 py37_0 defaults icu 58.2 h4b95b61_1 defaults idna 2.8 py37_0 defaults imageio 2.5.0 py37_0 defaults imagesize 1.1.0 py37_0 defaults importlib_metadata 0.17 py37_1 defaults intel-openmp 2019.4 233 defaults ipykernel 5.1.1 py37h39e3cac_0 defaults ipython 7.6.1 py37h39e3cac_0 defaults ipython_genutils 0.2.0 py37_0 defaults ipywidgets 7.5.0 py_0 defaults isort 4.3.21 py37_0 defaults itsdangerous 1.1.0 py37_0 defaults jbig 2.1 h4d881f8_0 defaults jdcal 1.4.1 py_0 defaults jedi 0.13.3 py37_0 defaults jinja2 2.10.1 py37_0 defaults joblib 0.13.2 py37_0 defaults jpeg 9b he5867d9_2 defaults json5 0.8.4 py_0 defaults jsonschema 3.0.1 py37_0 defaults jupyter 1.0.0 py37_7 defaults jupyter_client 5.3.1 py_0 defaults jupyter_console 6.0.0 py37_0 defaults jupyter_core 4.5.0 py_0 defaults jupyterlab 1.0.2 py37hf63ae98_0 defaults jupyterlab_server 1.0.0 py_0 defaults keyring 18.0.0 py37_0 defaults kiwisolver 1.1.0 py37h0a44026_0 defaults krb5 1.16.1 hddcf347_7 defaults lazy-object-proxy 1.4.1 py37h1de35cc_0 defaults libarchive 3.3.3 h786848e_5 defaults libcurl 7.65.2 h051b688_0 defaults libcxx 4.0.1 hcfea43d_1 defaults libcxxabi 4.0.1 hcfea43d_1 defaults libedit 3.1.20181209 hb402a30_0 defaults libffi 3.2.1 h475c297_4 defaults libgfortran 3.0.1 h93005f0_2 defaults libiconv 1.15 hdd342a3_7 defaults liblief 0.9.0 h2a1bed3_2 defaults libpng 1.6.37 ha441bb4_0 defaults libsodium 1.0.16 h3efe00b_0 defaults libssh2 1.8.2 ha12b0ac_0 defaults libtiff 4.0.10 hcb84e12_2 defaults libxml2 2.9.9 hf6e021a_1 defaults libxslt 1.1.33 h33a18ac_0 defaults llvm-openmp 4.0.1 hcfea43d_1 defaults llvmlite 0.29.0 py37h98b8051_0 defaults locket 0.2.0 py37_1 defaults lxml 4.3.4 py37hef8c89e_0 defaults lz4-c 1.8.1.2 h1de35cc_0 defaults lzo 2.10 h362108e_2 defaults markupsafe 1.1.1 py37h1de35cc_0 defaults matplotlib 3.1.0 py37h54f8f79_0 defaults mccabe 0.6.1 py37_1 defaults mistune 0.8.4 py37h1de35cc_0 defaults mkl 2019.4 233 defaults mkl-service 2.0.2 py37h1de35cc_0 defaults mkl_fft 1.0.12 py37h5e564d8_0 defaults mkl_random 1.0.2 py37h27c97d8_0 defaults mock 3.0.5 py37_0 defaults more-itertools 7.0.0 py37_0 defaults mpc 1.1.0 h6ef4df4_1 defaults mpfr 4.0.1 h3018a27_3 defaults mpmath 1.1.0 py37_0 defaults msgpack-python 0.6.1 py37h04f5b5a_1 defaults multipledispatch 0.6.0 py37_0 defaults navigator-updater 0.2.1 py37_0 defaults nbconvert 5.5.0 py_0 defaults nbformat 4.4.0 py37_0 defaults ncurses 6.1 h0a44026_1 defaults networkx 2.3 py_0 defaults nltk 3.4.4 py37_0 defaults nose 1.3.7 py37_2 defaults notebook 6.0.0 py37_0 defaults numba 0.44.1 py37h6440ff4_0 defaults numexpr 2.6.9 py37h7413580_0 defaults numpy 1.16.4 py37hacdab7b_0 defaults numpy-base 1.16.4 py37h6575580_0 defaults numpydoc 0.9.1 py_0 defaults olefile 0.46 py37_0 defaults openpyxl 2.6.2 py_0 defaults openssl 1.1.1c h1de35cc_1 defaults packaging 19.0 py37_0 defaults pandas 0.24.2 py37h0a44026_0 defaults pandoc 2.2.3.2 0 defaults pandocfilters 1.4.2 py37_1 defaults parso 0.5.0 py_0 defaults partd 1.0.0 py_0 defaults path.py 12.0.1 py_0 defaults pathlib2 2.3.4 py37_0 defaults patsy 0.5.1 py37_0 defaults pcre 8.43 h0a44026_0 defaults pep8 1.7.1 py37_0 defaults pexpect 4.7.0 py37_0 defaults pickleshare 0.7.5 py37_0 defaults pillow 6.1.0 py37hb68e598_0 defaults pip 19.1.1 py37_0 defaults pkginfo 1.5.0.1 py37_0 defaults pluggy 0.12.0 py_0 defaults ply 3.11 py37_0 defaults prometheus_client 0.7.1 py_0 defaults prompt_toolkit 2.0.9 py37_0 defaults psutil 5.6.3 py37h1de35cc_0 defaults ptyprocess 0.6.0 py37_0 defaults py 1.8.0 py37_0 defaults py-lief 0.9.0 py37h1413db1_2 defaults pycodestyle 2.5.0 py37_0 defaults pycosat 0.6.3 py37h1de35cc_0 defaults pycparser 2.19 py37_0 defaults pycrypto 2.6.1 py37h1de35cc_9 defaults pycurl 7.43.0.3 py37ha12b0ac_0 defaults pyflakes 2.1.1 py37_0 defaults pygments 2.4.2 py_0 defaults pylint 2.3.1 py37_0 defaults pyodbc 4.0.26 py37h0a44026_0 defaults pyopenssl 19.0.0 py37_0 defaults pyparsing 2.4.0 py_0 defaults pyqt 5.9.2 py37h655552a_2 defaults pyrsistent 0.14.11 py37h1de35cc_0 defaults pysocks 1.7.0 py37_0 defaults pytables 3.5.2 py37h5bccee9_1 defaults pytest 5.0.1 py37_0 defaults pytest-arraydiff 0.3 py37h39e3cac_0 defaults pytest-astropy 0.5.0 py37_0 defaults pytest-doctestplus 0.3.0 py37_0 defaults pytest-openfiles 0.3.2 py37_0 defaults pytest-remotedata 0.3.1 py37_0 defaults python 3.7.3 h359304d_0 defaults python-dateutil 2.8.0 py37_0 defaults python-libarchive-c 2.8 py37_11 defaults python.app 2 py37_9 defaults pytz 2019.1 py_0 defaults pywavelets 1.0.3 py37h1d22016_1 defaults pyyaml 5.1.1 py37h1de35cc_0 defaults pyzmq 18.0.0 py37h0a44026_0 defaults qt 5.9.7 h468cd18_1 defaults qtawesome 0.5.7 py37_1 defaults qtconsole 4.5.1 py_0 defaults qtpy 1.8.0 py_0 defaults readline 7.0 h1de35cc_5 defaults requests 2.22.0 py37_0 defaults rope 0.14.0 py_0 defaults ruamel_yaml 0.15.46 py37h1de35cc_0 defaults scikit-image 0.15.0 py37h0a44026_0 defaults scikit-learn 0.21.2 py37h27c97d8_0 defaults scipy 1.3.0 py37h1410ff5_0 defaults seaborn 0.9.0 py37_0 defaults send2trash 1.5.0 py37_0 defaults setuptools 41.0.1 py37_0 defaults simplegeneric 0.8.1 py37_2 defaults singledispatch 3.4.0.3 py37_0 defaults sip 4.19.8 py37h0a44026_0 defaults six 1.12.0 py37_0 defaults snappy 1.1.7 he62c110_3 defaults snowballstemmer 1.9.0 py_0 defaults sortedcollections 1.1.2 py37_0 defaults sortedcontainers 2.1.0 py37_0 defaults soupsieve 1.8 py37_0 defaults sphinx 2.1.2 py_0 defaults sphinxcontrib 1.0 py37_1 defaults sphinxcontrib-applehelp 1.0.1 py_0 defaults sphinxcontrib-devhelp 1.0.1 py_0 defaults sphinxcontrib-htmlhelp 1.0.2 py_0 defaults sphinxcontrib-jsmath 1.0.1 py_0 defaults sphinxcontrib-qthelp 1.0.2 py_0 defaults sphinxcontrib-serializinghtml 1.1.3 py_0 defaults sphinxcontrib-websupport 1.1.2 py_0 defaults spyder 3.3.6 py37_0 defaults spyder-kernels 0.5.1 py37_0 defaults sqlalchemy 1.3.5 py37h1de35cc_0 defaults sqlite 3.29.0 ha441bb4_0 defaults statsmodels 0.10.0 py37h1d22016_0 defaults sympy 1.4 py37_0 defaults tblib 1.4.0 py_0 defaults terminado 0.8.2 py37_0 defaults testpath 0.4.2 py37_0 defaults tk 8.6.8 ha441bb4_0 defaults toolz 0.10.0 py_0 defaults tornado 6.0.3 py37h1de35cc_0 defaults tqdm 4.32.1 py_0 defaults traitlets 4.3.2 py37_0 defaults unicodecsv 0.14.1 py37_0 defaults unixodbc 2.3.7 h1de35cc_0 defaults urllib3 1.24.2 py37_0 defaults wcwidth 0.1.7 py37_0 defaults webencodings 0.5.1 py37_1 defaults werkzeug 0.15.4 py_0 defaults wheel 0.33.4 py37_0 defaults widgetsnbextension 3.5.0 py37_0 defaults wrapt 1.11.2 py37h1de35cc_0 defaults wurlitzer 1.0.2 py37_0 defaults xlrd 1.2.0 py37_0 defaults xlsxwriter 1.1.8 py_0 defaults xlwings 0.15.8 py37_0 defaults xlwt 1.3.0 py37_0 defaults xz 5.2.4 h1de35cc_4 defaults yaml 0.1.7 hc338f04_2 defaults zeromq 4.3.1 h0a44026_3 defaults zict 1.0.0 py_0 defaults zipp 0.5.1 py_0 defaults zlib 1.2.11 h1de35cc_3 defaults zstd 1.3.7 h5bba6e5_0 defaults ```
Debilski commented 5 years ago

Can confirm the problem on a fresh macOS 10.14.6 with miniconda and tk=8.6.8. I want to add the the problem also occurred in the beta for macOS Catalina 10.15 that was released before 10.14.6 (beta 4, I think) but was then apparently resolved in the beta that arrived after 10.14.6 (beta 5). I am not testing the betas anymore currently, so I won’t be able to give further input on that.

kcarnold commented 5 years ago

I unfortunately confirm this bug on a fresh install of both macOS 10.14.6 and Anaconda. It's clearly Apple's bug; has anyone reported it?

I've attached the full WindowServer_2019-08-07-092951_Kenneths-MacBook-Pro.crash.txt

crashdump; here's the relevant part:

Process:               WindowServer [9531]
Path:                  /System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/Resources/WindowServer
Identifier:            WindowServer
Version:               600.00 (340.54)
Code Type:             X86-64 (Native)
Parent Process:        launchd [1]
Responsible:           WindowServer [9531]
User ID:               88

Date/Time:             2019-08-07 09:29:04.096 -0400
OS Version:            Mac OS X 10.14.6 (18G87)
Report Version:        12
Anonymous UUID:        78BD0FA6-6033-BEED-4187-9247033D9778

Sleep/Wake UUID:       1476ADD3-4C0B-4904-8657-1268CD642BF9

Time Awake Since Boot: 30000 seconds
Time Since Wake:       400 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [9531]

VM Regions Near 0:
--> 
    __TEXT                 000000010a3f4000-000000010a3f6000 [    8K] r-x/rwx SM=COW  /System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/Resources/WindowServer

Application Specific Information:
StartTime:2019-08-07 09:27:37
GPU:IG&NV
MetalDevice for accelerator(0x3703): 0x7f919b027408 (MTLDevice: 0x10d09b000)
MetalDevice for accelerator(0x4827): 0x7f9199c0b6c8 (MTLDevice: 0x10d068000)
IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/P0P2@1/IOPP/GFX0@0/NVDA,Display-D@3/NVDA
IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/P0P2@1/IOPP/GFX0@0/NVDA,Display-A@0/NVDA

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.SkyLight              0x00007fff55a54485 CGXBeginSurfaceLayerUpdate + 3207
1   com.apple.SkyLight              0x00007fff55b031a9 prepare_CoreAnimation_update_state(CGXConnection*, CGXWindowSubArray, bool, bool) + 636
2   com.apple.SkyLight              0x00007fff55afec39 CGXUpdateDisplay + 7081
3   com.apple.SkyLight              0x00007fff55afce20 update_display_callback(void*, double) + 298
4   com.apple.SkyLight              0x00007fff55b418a1 run_timer_pass + 489
5   com.apple.SkyLight              0x00007fff55b73bd2 CGXRunOneServicesPass + 180
6   com.apple.SkyLight              0x00007fff55b74d52 server_loop + 602
7   com.apple.SkyLight              0x00007fff55b74af1 SLXServer + 1349
8   WindowServer                    0x000000010a3f550d 0x10a3f4000 + 5389
9   libdyld.dylib                   0x00007fff5c7133d5 start + 1
evangelos1 commented 5 years ago

Same here, the problem started occurring after the recent update to Mojave 10.14.6. Using the stock Anaconda 2019.07 distribution.

Stannislav commented 5 years ago

Same here - recently updated to Mojave 10.14.6 and tkinter started crashing my mac knocking me back to the login screen.

bentkidder commented 5 years ago

Same here - reported this to Apple earlier today

chtoby commented 5 years ago

same issue here!

jjhelmus commented 5 years ago

This may be related to a similar issue report to conda-forge, conda-forge/tk-feedstock#36

fankaisong commented 5 years ago

I have finally found this post. I have been searching around why I have this bug until this post Same issue here

wmfschneider commented 5 years ago

Same issue....

sharahamo commented 5 years ago

Same issue here

TheodoreEhrenborg commented 5 years ago

I have this issue on a 9-day old MacBook Pro running macOS 10.14.6 and Anaconda 2019.07. I'll report it to Apple.

TheodoreEhrenborg commented 5 years ago

This problem does not appear when I run tk=8.6.8 and Python 3.7.0, nor does it appear when I run tk=8.6.7 and Python 3.7.0. I do experience the issue when I run tk=8.6.8 and Python 3.7.4.

sharahamo commented 5 years ago

@TheodoreEhrenborg I can verify this. I downgraded to 3.7.0 and it works

vichug commented 5 years ago

@TheodoreEhrenborg i can confirm, also have a 3 days old mbp with macOS 10.14.6 and anaconda installed, using tk did immediately crash as the issue title says, downgrading to 3.7.0 solved the issue. Maybe it is a Python side issue then ?

TheodoreEhrenborg commented 5 years ago

According to @tazzben the bug only occurs when Anaconda is installed.

I guess Anaconda treats Python 3.7.4 differently from Python 3.7.0, and this somehow activates a glitch in macOS 10.14.6 when using tkinter. But I don't understand where the problem is coming from.

Debilski commented 5 years ago

The 10.14.6 Supplemental Update does not solve the problem, btw.

hammondm commented 5 years ago

Reinstalling 'tk' using conda eliminates the crash, but tkinter then does not behave properly. Windows appear, but no visible contents.

TheodoreEhrenborg commented 5 years ago

What method did you use to reinstall tk? I ran "conda install tk --force-reinstall", and my windowing system still crashed when I used Tkinter (with Python 3.7.3 and tk=8.6.8). I tried removing tk ("conda remove --force tk") and then installing tk again, but that did not stop the crashes.

hammondm commented 5 years ago

I just did 'conda install tk' and that did it.

But, as I said, while the system doesn't crash, tk(inter) still doesn't work right.

TheodoreEhrenborg commented 5 years ago

I don't know why our systems are responding differently.

Congratulations on finding a new way that the bug manifests itself.

hlgirard commented 5 years ago

Same issue here. Did anyone get an answer from Apple?

TheodoreEhrenborg commented 5 years ago

@hlgirard I haven't yet.

When the bug happens to me, sometimes the image on my screen gets squished into the top left corner, so there is a band of nonfunctional pixels (about an inch wide) along the bottom and right of my screen. I can only fix this by restarting my computer. Does this happen to anyone else?

ck-developers commented 5 years ago

I have the same problem.

kheirmirza commented 5 years ago

Did anyone find a fix? I have the same issue

chtoby commented 5 years ago

Just find history version, I installed 2018 December version. It worked.

On Fri, 13 Sep 2019, 10:50 pm kheirmirza, notifications@github.com wrote:

Did anyone find a fix? I have the same issue

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ContinuumIO/anaconda-issues/issues/11165?email_source=notifications&email_token=AM5LFL42N37B2AEJAC5SV6TQJOEARA5CNFSM4IIFQSI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6U5OGY#issuecomment-531224347, or mute the thread https://github.com/notifications/unsubscribe-auth/AM5LFL3PFQHWNTVCZRX4T4TQJOEARANCNFSM4IIFQSIQ .

ValKanAll commented 5 years ago

Just downgraded python to 3.7.0 and it worked fine. You might need to set a new environment because lots of packages will get conflicts as they are made for the last python version. I used "conda create -n visual python=3.7.0" to create an environment only for my use of Tkinter. Then you can install the extra packages you need.

kheirmirza commented 5 years ago

Thanks so much it worked! @ValKanAll and @chtoby you are both amazing.

pgunn commented 5 years ago

Downgrading to 3.7.0 is not a full solution; several things a tk program can do will still kill the login session (e.g. opening a second window).

TheodoreEhrenborg commented 5 years ago

@pgunn With Python=3.7.0 and tk=8.6.8, I ran "from tkinter import Tk; Tk(); Tk()". This opened two tk windows but did not cause the windowing system to crash.

What tk program did you run to get your windowing system to crash? I'm not very familiar with tk, so I don't know how multiple tk windows are usually used.

pgunn commented 5 years ago

I'm making a sanitised version of my script that I can share. Should be able to toss it on pastebin within an hour.

pgunn commented 5 years ago

@TheodoreEhrenborg Here's a pastebin.

https://pastebin.com/TqgyWXar

My system:

C02VF0SQHTDH:~/src/waspem-tooling/data_managers$ conda list | grep python
python                    3.7.0                hc167b69_0  
C02VF0SQHTDH:~/src/waspem-tooling/data_managers$ conda list | grep tk
tk                        8.6.8                ha441bb4_0
C02VF0SQHTDH:~/src/waspem-tooling/data_managers$ uname -a
Darwin C02VF0SQHTDH 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64
pgunn commented 5 years ago

Note that it crashes when you click the (non-quit) button, not when it's initially launching

TheodoreEhrenborg commented 5 years ago

@pgunn Thanks for the script. I ran "python paintman.py" and clicked on the "Work on" button. This opened a "work" window successfully. Maybe I misunderstood your instructions.

Screen Shot 2019-09-20 at 8 41 08 PM Screen Shot 2019-09-20 at 8 41 12 PM
pgunn commented 5 years ago

No, it sounds like for some reason it's crashing for me and not for you. Weird. Let me know if there's more debugging you'd like me to try to explore differences between our systems. For me that "Work on" button is the ticket to a crash.

TheodoreEhrenborg commented 5 years ago

I agree it's weird. I hope the next macOS release fixes it.

tazzben commented 4 years ago

Unfortunately the supplemental release (pushed out today or yesterday) does not seem to resolve this issue.

maxime915 commented 4 years ago

I had the same issue with an anaconda environment with python3.6.9 (TkVersion=8.6), I created another environment with python 3.6.6 (TkVersion=8.6) and it works for me now (macOS 10.14.6, conda 4.7.12)

TheodoreEhrenborg commented 4 years ago

@maxime915 Python 3.6.9 and Python 3.7.4, which both have the issue, were released in July 2019. Python 3.6.6 and Python 3.7.0, which don't have the issue, were released in 2018. It seems plausible that the issue manifests because of something that Python has changed. The actual bug could be in Python, Anaconda, or Apple. But the bug seems to be responding to some quality of more recent Python releases.

Of course, this is just speculation. I hope macOS Catalina will fix this issue, although I won't upgrade until it has been released successfully without other bugs.

Debilski commented 4 years ago

Current Catalina beta (GM) indeed doesn’t seem to have the problem. It would still be good to see a fix on 10.14 though for users of 32 bit apps who cannot upgrade.

vichug commented 4 years ago

i hope developers, especially in the FOSS community, won't rush to Catalina and drop support of previous OSes, as I will have to stick for a while with Mojave (and suppose i'm not the only one)

clemencebic commented 4 years ago

I had the same problem on Mac OS 10.14.6, I am using anaconda. As I could not change the tk version without recompiling python (https://www.python.org/download/mac/tcltk/ I had to downgrade my python version. The python version 3.6.0 worked well, later and earlier version crashed.

mattsliv commented 4 years ago

For anyone having this issue using Tk with matplotlib, I replaced matplotlib.use('TkArg') with matplotlib.use('MacOSX') and the issues seem to be resolved. Not sure how though.

vqbang commented 4 years ago

@mattsliv Many thanks :D save me tons of hours on looking for a solution.

sean-johnson commented 4 years ago

I had the same problem, I found another solution if you are using anaconda. In matplotlib's docs they recommend installing the python framework:

"On OSX, two different types of Python builds exist: a regular build and a framework build. In order to interact correctly with OSX through the native GUI frameworks, you need a framework build of Python."

https://matplotlib.org/3.1.0/faq/osx_framework.html

So following their conda recommendations I ensured python.app framework was installed on my env with conda install python.app . Then instead of using the command python plot-file.py to run my file, I used pythonw plot-file.py to run it. Everything worked fine.

harryparker commented 4 years ago

@sean-johnson , Thanks, for the solution. I didn't do a separate conda python install like you did. However I did do a "conda update --all" today in trying to resolve this problem. (That didn't help, although it did upgrade my python from 3.7.3 to 3.7.6.)

I tried using "pythonw -m tkinter" from the MacOS 10.14.6 Terminal. This worked successfully when doing the same with "python" instesad of "pythonw" kicked me out to the login screen as others have described.

I note that "pythonw" runs python version 3.7.0 on my machine, while "python" runs 3.7.6. This may explain why it works as others found a solution by downgrading to python 3.7.0.

qnguyenn commented 4 years ago

Mac os Mojave 10.14.6. the problem come from that my python 3.7.6 is in the anaconda package (/opt/anaconda3/bin/python) tkinter app cause the system log out abruptly. Downloading python 3.7.6 installer (for macosx 64) from www.python.org and run the installer, python is in the system (/Library/Frameworks/Python.framework/Versions/3.7/bin/python) Tkinter app work fine.

patiencing commented 4 years ago

I have the same problem on MacOS 10.14.6 with Python 3.7.6, and it dosen't work for me to downgrade to 3.7.0.

I solved this problem by using old tkinter: I uninstalled the Python3 which is downloaded from python.org (it includes tkinter 8.6), and reinstall python by Homebrew (brew install python3). Homwbrew will install Python 3.7.7 without tkinter. So Python 3.7.7 will use the MacOS build-in tkinter(version = 8.5.9). It work fine for me.

But I don't use Anaconda, so you have to check if there are version problem. May be this documentation will help.