Answer the question
In order to leave comments, you need to log in
How to take a screenshot in python?
how to take a screenshot with python
code like this:
import numpy as np
import pyautogui
import imutils
import cv2
import time
time.sleep(15)
image = pyautogui.screenshot(region=(0,0, 300, 400))
cv2.imwrite( 'pic.png', image)
has this error:
Traceback (most recent call last):
File "E:\Games\python\Projects for python\image\img.py", line 2, in
import pyautogui
File "E: \Games\python\lib\site-packages\pyautogui\__init__.py", line 221, in
locateOnWindow.__doc__ = pyscreeze.locateOnWindow.__doc__
AttributeError: module 'pyscreeze' has no attribute 'locateOnWindow'
Answer the question
In order to leave comments, you need to log in
Apparently there is a version conflict between the libraries. Try to install these versions via pip (I just happened to have them at hand and worked successfully)
PyScreeze==0.1.26
PyAutoGUI==0.9.50
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question