ianzhao05 / textshot

Python tool for grabbing text via screenshot
MIT License
1.73k stars 259 forks source link

textshot on macOS Big Sur #28

Closed hasantahir closed 3 years ago

hasantahir commented 3 years ago

Hi,

On macOS 11.1, invoking python textshot.py throws a Qt GUI error:

QPixmap::fromImage: QPixmap cannot be created without a QGuiApplication
QPixmap: Must construct a QGuiApplication before a QPixmap

Any suggestions? This worked fine before updating to Big Sur. Thank you!

EDIT: This has been tried with a virtual environment.

ianzhao05 commented 3 years ago

Hi, I made a fix that should get rid of the error. The main issue is that Tesseract was not found in the system path, but the notification used Qt methods before an application was initialized. This would actually happen on all macOS and Linux machines if Tesseract is not present, so thanks for reporting this! Can you test out that branch?

hasantahir commented 3 years ago

Thanks for addressing this so soon. Before trying out the branch, I updated the dependencies PyQt5 to version 5.15.2 as opposed to the one mentioned in the requirements.txt. It fixed the mentioned error.

ianzhao05 commented 3 years ago

Alright, glad that it works. I'll update the dependencies too.