简体   繁体   中英

Pyscreenshot doesn't work with PyQt5(Pyinstaller)

When I am running my app from IDE, it works great, but if I run app built with PyInstaller, pyscreenshot.grab works like MainWindow.show() . I tried 3 different backends(PyQt5; PIL; default) and none of them work. If you dont understood me, you can watch video

If I close window, an error appears:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "threading.py", line 926, in _bootstrap_inner
  File "threading.py", line 870, in run
  File "main1.py", line 96, in main
  File "lib\site-packages\pyscreenshot\__init__.py", line 31, in grab
  File "lib\site-packages\pyscreenshot\loader.py", line 145, in backend_grab
  File "lib\site-packages\pyscreenshot\loader.py", line 136, in force
  File "lib\site-packages\pyscreenshot\childproc.py", line 39, in childprocess_grab
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\User\\AppData\\Local\\Temp\\pyscreenshotmrgm1pkk\\screenshot.png'

PS I am using dev version of PyInstaller, because I need TensorFlow support

Using PIL.ImageGrab.grab() instead of ps.grab() fixed problem

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM