Search code examples
pythonnumpypyautogui

How to solve this error of downloading pyautogui library?


It's throwing errors while trying to install Python pyautogui module. Anyone knows why it throws an error?

C:\Users\Mtronics>pip install pyautogui==0.9.35
Collecting pyautogui==0.9.35
  Downloading PyAutoGUI-0.9.35.zip (57 kB)
     |████████████████████████████████| 57 kB 415 kB/s
Collecting pymsgbox
  Using cached PyMsgBox-1.0.8.tar.gz (18 kB)
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\mtronics\appdata\local\programs\python\python38-32\python.exe' 'c:\users\mtronics\appdata\local\programs\python\python38-32\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\Mtronics\AppData\Local\Temp\pip-build-env-pvhbyby8\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel
       cwd: None
  Complete output (14 lines):
  Traceback (most recent call last):
    File "c:\users\mtronics\appdata\local\programs\python\python38-32\lib\runpy.py", line 194, in _run_module_as_main
      return _run_code(code, main_globals, None,
    File "c:\users\mtronics\appdata\local\programs\python\python38-32\lib\runpy.py", line 87, in _run_code
      exec(code, run_globals)
    File "c:\users\mtronics\appdata\local\programs\python\python38-32\lib\site-packages\pip\__main__.py", line 23, in <module>
      from pip._internal.cli.main import main as _main  # isort:skip # noqa
    File "c:\users\mtronics\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\cli\main.py", line 5, in <module>
      import locale
    File "c:\users\mtronics\appdata\local\programs\python\python38-32\lib\locale.py", line 16, in <module>
      import re
    File "c:\users\mtronics\appdata\local\programs\python\python38-32\lib\re.py", line 145, in <module>
      class RegexFlag(enum.IntFlag):
  AttributeError: module 'enum' has no attribute 'IntFlag'
  ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\mtronics\appdata\local\programs\python\python38-32\python.exe' 'c:\users\mtronics\appdata\local\programs\python\python38-32\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\Mtronics\AppData\Local\Temp\pip-build-env-pvhbyby8\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel Check the logs for full command output.

Solution

  • It is because you have a non standard enum module installed. It used to work before Python 3.6 but is no longer compatible with the standard libary.

    Run this command to uninstall it and then try again:

    pip uninstall -y enum34