RuntimeError: main thread is not in main loop
Console shuts down after I 'import importlib' and here is the error it gives.
>>> import importlib
Exception ignored in: <bound method Image.__del__ of <tkinter.PhotoImage object at 0x000001AF640E1D68>>
Traceback (most recent call last):
File "C:\Python36\lib\tkinter\__init__.py", line 3504, in __del__
self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop
Exception ignored in: <bound method Image.__del__ of <tkinter.PhotoImage object at 0x000001AF63DBD5F8>>
Traceback (most recent call last):
File "C:\Python36\lib\tkinter\__init__.py", line 3504, in __del__
self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop
Exception ignored in: <bound method Variable.__del__ of <tkinter.IntVar object at 0x000001AF6410B0F0>>
Traceback (most recent call last):
File "C:\Python36\lib\tkinter\__init__.py", line 329, in __del__
if self._tk.getboolean(self._tk.call("info", "exists", self._name)):
RuntimeError: main thread is not in main loop
Exception ignored in: <bound method Image.__del__ of <tkinter.PhotoImage object at 0x000001AF6410B5F8>>
Traceback (most recent call last):
File "C:\Python36\lib\tkinter\__init__.py", line 3504, in __del__
self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop
Exception ignored in: <bound method Variable.__del__ of <tkinter.IntVar object at 0x000001AF6367F470>>
Traceback (most recent call last):
File "C:\Python36\lib\tkinter\__init__.py", line 329, in __del__
if self._tk.getboolean(self._tk.call("info", "exists", self._name)):
RuntimeError: main thread is not in main loop
Exception ignored in: <bound method Image.__del__ of <tkinter.PhotoImage object at 0x000001AF6367F278>>
Traceback (most recent call last):
File "C:\Python36\lib\tkinter\__init__.py", line 3504, in __del__
self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop
Exception ignored in: <bound method Image.__del__ of <tkinter.PhotoImage object at 0x000001AF63AEA7F0>>
Traceback (most recent call last):
File "C:\Python36\lib\tkinter\__init__.py", line 3504, in __del__
self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop
Exception ignored in: <bound method Image.__del__ of <tkinter.PhotoImage object at 0x000001AF643492B0>>
Traceback (most recent call last):
File "C:\Python36\lib\tkinter\__init__.py", line 3504, in __del__
self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop
Exception ignored in: <bound method Image.__del__ of <tkinter.PhotoImage object at 0x000001AF640E1F60>>
Traceback (most recent call last):
File "C:\Python36\lib\tkinter\__init__.py", line 3504, in __del__
self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop
Exception ignored in: <bound method Image.__del__ of <tkinter.PhotoImage object at 0x000001AF629B3C50>>
Traceback (most recent call last):
File "C:\Python36\lib\tkinter\__init__.py", line 3504, in __del__
self.tk.call('image', 'delete', self.name)
RuntimeError: main thread is not in main loop
Tcl_AsyncDelete: async handler deleted by the wrong thread
请先登录再写评论。
Hello,
Please try another interpreter, change it in https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html, and reopen the console. Seem like interpreter-specific, as it is not reproducible for me with Python 3.8.
Hi Tonya,
I installed python 3.8 but the error persists. I am using PyCharm 2021.1. Could it be because I installed python in an internet drive of my institution?
>Could it be because I installed python in an internet drive of my institution?
Yes, it might be the cause. Please try installing Python locally and let me know how it goes.
I moved Python3.8 to my local drive (C) and the error happened again.
Hello,
Do you mean you have copied the folder where Python is installed to drive C? Or performed a new installation but to a different location?