Crash and the Mojave 10.14.6 login screen appears.
The problem started occurring after the update to Mojave 10.14.6. When I create a plot and click on the plot window icon on the dock, the screen goes black for a second and the macOS login screen appears. After I log in, the windows of Anaconda Navigator and Spyder are gone and their icons are no longer present on the Dock. Activity Monitor however indicates that python is still running.
I have reproduced this behavior a few times. Switching the IPython backend to Qt5 solved the problem.
Actually I only switched to Tkinter from Qt5 recently to avoid a slow execution problem with IPython 7.6. Then this crash issue started occurring after the recent macOS 10.14.6 update. Eventually I switched back to Qt5 and downgraded to IPython 6.5. Everything seems to be working as expected at the moment.
I have also started experiencing this crash and logout since I updated to Mojave 10.14.6. I haven't had any issues with any backends before this. I also kind of get an error message:
2019-08-07 09:43:59.219 python[5309:540054] +[NSXPCSharedListener endpointForReply:withListenerName:]: an error occurred while attempting to obtain endpoint for listener 'ClientCallsAuxiliary': Connection interrupted
2019-08-07 09:43:59.221 python[5309:536396] HIToolbox: received notification of WindowServer event port death.
2019-08-07 09:43:59.221 python[5309:536396] port matched the WindowServer port created in BindCGSToRunLoop
I just checked quick and it crashes when using Python 3.7.3, in both python and the ipython interpreter. Switching the backend to Qt5Agg seems to be working.
Same happened to me.
Yesterday I ran my script that use Tkinter and Matplotlib everything perfect. Today morning I updated th MacOSX, try to run the script and I got kicked off to the login window.
Then I try to run the tests from tinter library, and the same happened.
At least one person has reported this to Apple (ContinuumIO/anaconda-issues#11165 (comment)) not sure if this is a case where more reports helps let them know this is a real problem or not...
This appears to be an interaction between tk and OSX which we can not do much about on the Matplotlib side of things.
I had the same issue today; for the first time in 2 weeks i tried to run a python script featuring the tkinter library in a jupiter notebook (anaconda navigator): the screen went black for a few seconds and then the macOS login screen appeared. After I logged in, the windows of Anaconda Navigator and Jupiter are gone and their icons are no longer present on the Dock. I tried to open the Anaconda Navigator again and i got the following message: "there is an instance of anaconda navigator already running".
I tried multiple times this whole process but I always had the same result.
I couldn't find any explanation surfing the net and googling.
I know that this is a closed issue but since I didn't find a solution here I will share with you what worked for me. Downgrading from python 3.7.3 to python 3.7.0 solved my issue.
I have the same problem. Just ran "conda update --all" trying to resolve it. It didn't. However, after reading the related bug report at ContinuumIO/anaconda-issues#11165,
I tried replacing "python -m tkinter" (which kicked me out to the login screen) with
"pythonw -m tkinter". That worked!
I also noted that pythonw runs python 3.7.0 rather than python 3.7.6.
Activity
jklymak commented on Aug 7, 2019
can You reproduce without spyder? Are you sure tkinter is up to date. For what it’s worth I’ve never really had tk working on my Mac
evangelos1 commented on Aug 7, 2019
Hi Jody,
Yes. It seems this may not be a matplotlib-specific issue after all. See ContinuumIO/anaconda-issues#11165
Actually I only switched to Tkinter from Qt5 recently to avoid a slow execution problem with IPython 7.6. Then this crash issue started occurring after the recent macOS 10.14.6 update. Eventually I switched back to Qt5 and downgraded to IPython 6.5. Everything seems to be working as expected at the moment.
broulston commented on Aug 7, 2019
I have also started experiencing this crash and logout since I updated to Mojave 10.14.6. I haven't had any issues with any backends before this. I also kind of get an error message:
I just checked quick and it crashes when using Python 3.7.3, in both python and the ipython interpreter. Switching the backend to Qt5Agg seems to be working.
Dmaturana81 commented on Aug 15, 2019
Same happened to me.
Yesterday I ran my script that use Tkinter and Matplotlib everything perfect. Today morning I updated th MacOSX, try to run the script and I got kicked off to the login window.
Then I try to run the tests from tinter library, and the same happened.
MacOSX Mojave 10.14.6
matplotlib 3.0.3
Python 3.6
Pycharm 2018.1.4
tkinter
tacaswell commented on Aug 16, 2019
At least one person has reported this to Apple (ContinuumIO/anaconda-issues#11165 (comment)) not sure if this is a case where more reports helps let them know this is a real problem or not...
This appears to be an interaction between tk and OSX which we can not do much about on the Matplotlib side of things.
linscafe commented on Aug 17, 2019
Adding these two lines solved the problem for me.
import matplotlib
matplotlib.use("TkAgg")
MountainKing91 commented on Aug 19, 2019
I had the same issue today; for the first time in 2 weeks i tried to run a python script featuring the tkinter library in a jupiter notebook (anaconda navigator): the screen went black for a few seconds and then the macOS login screen appeared. After I logged in, the windows of Anaconda Navigator and Jupiter are gone and their icons are no longer present on the Dock. I tried to open the Anaconda Navigator again and i got the following message: "there is an instance of anaconda navigator already running".
I tried multiple times this whole process but I always had the same result.
I couldn't find any explanation surfing the net and googling.
manishkothakonda commented on Aug 19, 2019
@yiilih Adding the two lines:
import matplotlib
matplotlib.use("TkAgg")
was still crashing, I still did not figure out the problem. Let me know if anyone has figured out the mac crashing problem due to Tkinter.
efiring commented on Aug 19, 2019
This is a Tk problem; we can't do anything about it. Closing.
ImpatientLearning commented on Sep 17, 2019
I know that this is a closed issue but since I didn't find a solution here I will share with you what worked for me. Downgrading from python 3.7.3 to python 3.7.0 solved my issue.
ContinuumIO/anaconda-issues#11165 (comment)
michael-iuzzolino commented on Sep 19, 2019
Here's a complete solution that worked for me using Conda.
Setup the environment using Python 3.7.0, as @ImpatientLearning suggested.
$ conda create --n <env_name> python=3.7.0 pip
$ conda activate <env_name>
Install Matplotlib version 3.0.3
(env_name) $ pip install matplotlib==3.0.3
Finally, as @yiilih suggested, at the top of your <script_name>.py
JasonZhu1313 commented on Oct 15, 2019
It works for me. Just downgrade your python from 3.7.* to 3.7.0 and add those two lines.
adamlyu93 commented on Feb 13, 2020
I have the same issue and updating to macOS 10.15 solved my problem. I am using python 3.7.0, tk 8.6.8 in anaconda.
harryparker commented on Feb 18, 2020
I have the same problem. Just ran "conda update --all" trying to resolve it. It didn't. However, after reading the related bug report at ContinuumIO/anaconda-issues#11165,
I tried replacing "python -m tkinter" (which kicked me out to the login screen) with
"pythonw -m tkinter". That worked!
I also noted that pythonw runs python 3.7.0 rather than python 3.7.6.