Try using:
import pyscreenshot as imagegrab screenRef = imagegrab.grab()
you would then have to save it somewhere: screenRef.save(‘some file path here’)
i’m not sure if it differs between raspbian and an x86 OS, but you should have some luck there