asweigart / pyautogui

A cross-platform GUI automation Python module for human beings. Used to programmatically control the mouse & keyboard.
BSD 3-Clause "New" or "Revised" License
10.45k stars 1.26k forks source link

Deploy pyautogui on Heroku #632

Open AsmitaHari opened 3 years ago

AsmitaHari commented 3 years ago

Hi,

pyautogui works great on my windows local machine. I am trying to deploy to Heroku. The application I am trying to implement is for users with disabilities. I'm getting the following error Xlib. error.DisplayConnectionError: Can't connect to display ":0": Is there a way to fix it? Please help.

Thank you!!

winstxnhdw commented 3 years ago

PyAutoGUI does not work on systems that are headless. Heroku servers are headless.

Miltonbhowmick commented 3 years ago

PyAutoGUI does not work on systems that are headless. Heroku servers are headless.

Then what will the alternative way to take screenshot? I was deploying my project in pythonanywhere which is also saying Display:0 error.

winstxnhdw commented 3 years ago

AFAIK, there is no way to take screenshots on headless systems. Maybe if you Googled harder than I did, you may find a hacky solution.

Miltonbhowmick commented 3 years ago

AFAIK, there is no way to take screenshots on headless systems. Maybe if you Googled harder than I did, you may find a hacky solution.

I am trying it from one day long. Can you give any hints on that solution if you know?

winstxnhdw commented 3 years ago

I don't. All the best.

gustavofelicidade commented 2 years ago

Hello Miltonbhowmick Have you got a solution? I need to do a similar job that uses pyautogui on heroku and I need that solution. If you still want that solution let me know asap, thanks in advance!

I am thiking in compile the python script.

Miltonbhowmick commented 2 years ago

Hello Miltonbhowmick Have you got a solution? I need to do a similar job that uses pyautogui on heroku and I need that solution. If you still want that solution let me know asap, thanks in advance!

I am thiking in compile the python script.

No, i did not get solution. Actually, you can not use pyautogui in heroku because heroku is a headless server. And pyautogui is not supported of headless server.

SamiTesla commented 2 years ago

Yeah I did some research there really isn't an option to get heroku to accept pyautogui maybe you can distribute flash drives?

gustavofelicidade commented 2 years ago

I'm thinking use watchdog to verify changes in a folder, kind heroku can host download file and then the bot starts when this file get in local sys

SamiTesla @.***> escreveu no dia domingo, 21/08/2022 à(s) 16:44:

Yeah I did some research there really isn't an option to get heroku to accept pyautogui maybe you can distribute flash drives?

— Reply to this email directly, view it on GitHub https://github.com/asweigart/pyautogui/issues/632#issuecomment-1221608992, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ673SDAOMLK5NJ6ADCEHI3V2KBJ7ANCNFSM5GAQ4MYA . You are receiving this because you commented.Message ID: @.***>