RuntimeError: main thread is not in main loop
Exception ignored in: <function Image.
del
at 0x7f5768288940>
Traceback (most recent call last):
File “/home/ubuntu/anaconda3/envs/torch17/lib/python3.9/tkinter/
init
.py”, line 4015, 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
Aborted (core dumped)
这种错误是matplotlib版本不匹配的问题
pip install -U matplotlib
【debug】RuntimeError: main thread is not in main loop Exception ignored in: <function Image.__del__ a
RuntimeError: main thread is not in main loopException ignored in: <function Image.del at 0x7f5768288940>Traceback (most recent call last):File “/home/ubuntu/anaconda3/envs/torch17/lib/python3.9/tkinter/init.py”, line 4015, in delself.tk.call(‘im
编译ROS工程的过程中,因为安装了anaconda导致系统库的路径被覆盖掉,因而报错的时候
runtime
library [libssl.so.1.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in: /home/rw/anaconda3/lib
首先查看路径,可以看到返回结果中,第一个查找路径是anaconda的。
export $PATH
bash: export: `/home/rw/anaconda3/bin:/home/rw/anaconda3/condabin:/home/rw/.local/bin:/usr/lo
二、问题分析
在多卡训练的时候和某个子线程冲突,大概率是因为每个epoch结束都使用了matplotlib和sns等作图工具包, 相当于进入了另一个线程之中。在主线程
main
和作图的小线程来回,很容易线程出错。且随着训练过程,epoch越大,出错概率越大。
把相应的作图工具代码注释就好了;
paramiko
Exception
ignore
d in: <
function
BufferedFile.
del
at 0x109259820>
Attribute
Error
: ‘NoneType’ object has no attribute ‘time’
1. 代码
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import paramiko
import s
在使用tkinter 时,添加了一个线程来实现定时任务,虽然能够运行,但是出现了
main
thread
is not in
main
l
oop
的错误,具体原因是tkinter包的问题,
安装改进版本的tkinter 即可,代码也不需要做修改
pip install mtTkinter
使用的时候
from mttkinter import mtTkinter as tk
Runtime
Error
: Event l
oop
is closed一、异步redis连接(aioredis)1.代码2.报错详情3.解决方案总结
一、异步redis连接(aioredis)
import asyncio
import aioredis
async def execute(address, password):
print('开始执行', address)
# 网络IO操作:创建redis连接
redis = await aioredis.create_
Exception
ignore
d in: <
function
BaseMySQLSocket.__
del
__ at 0x000002C85CBADF70>
Traceback (most recent call last):
File "D:\software installation\Aut
oOp
erate\venv\lib\site-packages\mysql\connector\network.py", li.
这个错误消息表明在你的代码中定义了一个叫做 "implement_array_
function
" 的方法,但这个方法已经有了一个文档字符串(docstring)。这意味着你在同一个方法中多次定义了文档字符串,这是不允许的。
为了解决这个错误,你需要找到你的代码中定义 "implement_array_
function
" 方法的位置,并确保在这个方法中只有一个文档字符串。
希望这能帮到你!
VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tupl
42441