2

So, I am trying to install the pyautogui module on Repl.it, on a Chromebook. I am aware that a Chromebook and online IDE's are not the ideal way to run Python or any code for that matter, but that is my only option right now. Anyway, when I enter in the code shown below, I receive the error below. What is going on here and how can I fix it? I am aware that because of the technical restrictions of my basic (not in developer mode) Chromebook, this problem may not be solvable in the Chrome Environment.

import pyautogui


Traceback (most recent call last):
  File "python", line 9, in <module>
KeyError: 'DISPLAY'
Ben
  • 21
  • 3

1 Answers1

1

The problem is the python code is running on the repl.it server. This server does not have a display attached to it. Because of this, there is no screen and no mouse to move and pyautogui can't do anything. Furthermore, a web browser tab doesn't have permissions to move the mouse and do all the things pyautogui can. You will need to have the python code run on your device to use it. To record keystrokes and mouse position, you may want to look into javascript as it doesn't require any installation.

whackamadoodle3000
  • 6,684
  • 4
  • 27
  • 44