报错: PPOCRlabel运行报错QObject::moveToThread: Current thread (0x55d47a28a540) is not the object‘s thread

文章目录

  • 问题描述
  • 解决方法
  • 参考资料

问题描述

想安装 PaddleOCR 的标注工具用,系统环境 ubuntu20.04/18.04 都试过, 按照教程,在conda环境里面直接:

pip install pyqt5
cd ./PPOCRLabel  # 切换到PPOCRLabel目录
python PPOCRLabel.py --lang ch

结果报错显示:

QObject::moveToThread: Current thread (0x55d47a28a540) is not the object's thread (0x55d47a3a1be0).                                                                                            
Cannot move to target thread (0x55d47a28a540)                                                                                                                                                  
                                                                                                                                                                                               
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/gpu-server/anaconda3/envs/ppocr_hq/lib/python3.7/site-packages/cv2/qt/plugins" even though it was found.                  
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.                                                        
                                                                                                                                                                                               
Available platform plugins are: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl.                         
                                                                                                                                                                                               
                                                                                                                                                                                               
                                                                                                                                                                                               
--------------------------------------                                                                                                                                                         
C++ Traceback (most recent call last):                                                                                                                                                         
--------------------------------------                                                                                                                                                         
No stack trace in paddle, may be caused by external reasons.                                                                                                                                   
                                                                                                                                                                                               
----------------------                                                                                                                                                                         
Error Message Summary:                                                                                                                                                                         
----------------------                                                                                                                                                                         
FatalError: `Process abort signal` is detected by the operating system.                                                                                                                        
  [TimeInfo: *** Aborted at 1645608694 (unix time) try "date -d @1645608694" if you are using GNU date ***]                                                                                    
  [SignalInfo: *** SIGABRT (@0x3e8000014dd) received by PID 5341 (TID 0x7f36115bb0c0) from PID 5341 ***]                                                                                       
                                                                                                                                                                                               
Aborted (core dumped)  

按照网上教程,使用ldd 查过xcb 的链接库,发现没有问题.

解决方法

最后发现这个报错是 opencv 4.5 和 pyqt5 有冲突.解决方法是要么使用opencv-headless,要么使用conda安装pyqt5

我的解决方法是:

pip uninstall pyqt5
pip uninstall pyqt5-sip
conda install pyqt

参考资料

  • https://blog.csdn.net/ustczhng2012/article/details/115137510

你可能感兴趣的:(python,爬坑记录,qt,python,paddlepaddle)