lukas-blecher / LaTeX-OCR

pix2tex: Using a ViT to convert images of equations into LaTeX code.
https://lukas-blecher.github.io/LaTeX-OCR/
MIT License
12.01k stars 985 forks source link

QWidget: Must construct a QApplication before a QWidget #247

Open VijayN10 opened 1 year ago

VijayN10 commented 1 year ago

Hello, After running latexocr I am getting this error of QWidget: Must construct a QApplication before a QWidget Can someone help me? Thank you..

zhaozhibiao commented 1 year ago

Same problem

slabzzz commented 1 year ago

Same problem. The software seems broken.

zhaozhibiao commented 1 year ago

My problem was solved in specifying pyqt5 version. I found that when installing pix2tex with pip, pyqt5 5.15 or later is installed by default, but this conflicts with components such as pyqt5-tools. This does not seem to be a problem with Latex-ocr, because I found that qt5 software such as Spyder cannot run also, and the same error is reported. So I tried to use "pip check" to view package conflicts, manually specify the version of pyqt5 (pip intall pyqt5==5.12.3), and solved this problem.

VijayN10 commented 1 year ago

Hello @zhaozhibiao,

thank you for sharing your solution to install pyqt5 with specifying the version. Somehow it did not work for me. I had a similar issue with pyqt version 5.15.7 installed and the same error message appeared.

Do you have any other suggestions or solutions that may help resolve this issue?

Thank you for your assistance.