Using PYAUTOGUI with Colaboratory – Not possible Today

Using PYAUTOGUI with Colaboratory – Not possible Today

Using Pyautogui with Colaboratory is not currently possible because the code isn’t running with an active display, rather it’s more of a web based place to run python… In this blog I show you the basics and you can follow along on my Colaboratory.

Being super new at python, and just discovering Colaboratory, I figured, might as well test this new python library Pyautogui, in Colaboratory, not really thinking about the logic of the code.

GUI automation should be accomplished on a local machine. Colaboratory is a nice place to add code related to pyautogui, and explain pyautogui, but it will not be a place for GUI automation as it does not have a relevant display, being that a server is running the code, you don’t have a relevant display… Literally none what-so-ever..

A screenshot of colaboratory when trying pyautogui

PyAutoGUI in Colaboratory to show what’s happening when you try pyautogui.

It was an interesting find and wasn’t surprised to see others are trying but no details on how it works in Colaboratory.

How I learned about pyautogui not working in colaboratory…

So, While automating boring stuff – I found a library called pyautogui.

Installing pyautogui is helpful if you’re looking to automate with python on your personal computer.

Which makes sense because a web based version of python isn’t going to drive your computer? Maybe in the future but the idea here is the process is happening in Colaboratory.

Colaboratory is an online colaboration tool that lets you write code, add files, and document python or other related topics. Mostly Python…

Pyautogui is developed to help people automate on their personal computer, taking advantage of your display, taking over operating system, mouse, keyboard… and moving the mouse to different directions, etc…

Want to see how Colaboratory treats Pyautogui today? I built out a bit of pyautogui and even explain why Pyautogui will not work with Colaboratory.

Follow along here.