0

Hey I wanted to make a bot for the humenbenchmark aim training (https://humanbenchmark.com/tests/aim) but when I try to import imagegrab I get a really long error and I don't know what it means. The error is:

  `File "(Path to my python file)", line 1, in <module>
  from PIL import ImageGrab File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 779, in exec_module
  File "<frozen importlib._bootstrap_external>", line 915, in get_code
  File "<frozen importlib._bootstrap_external>", line 973, in get_data
  OSError: [Errno 22] Invalid argument`

And my code is:

from PIL import ImageGrab

Edit: I started testing a little bit and figured out that imagegrab isn't the only module giving that error. Numpy and pyautogui doesn't work either but modules like random and time does work.

zon146
  • 3
  • 2

1 Answers1

0

Answer: If you are on Windows 10, use the CMD (Command prompt) to run the script.

Visual Studio Code sometimes has trouble running it directly through itself.

Mathias
  • 149
  • 1
  • 10