无法在Python 3.864位Windows上安装PyAutoGUI

问题描述

我在安装pyautogui时遇到错误,我无法找出问题所在。我尝试使用pip安装它。我也使用Anaconda安装了它,但是无法将其导入Python。任何帮助表示赞赏。

版本:Python 3.8

操作系统:Windows 10

使用的命令:pip install pyautogui

错误

ERROR: Command errored out with exit status 1:
       command: 'C:\Program Files\python38\python.exe' 'C:\Users\HP\AppData\Roaming\Python\python38\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\HP\AppData\Local\Temp\pip-build-env-j7d0dtw8\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:\Program Files\python38\lib\runpy.py",line 194,in _run_module_as_main
          return _run_code(code,main_globals,None,File "C:\Program Files\python38\lib\runpy.py",line 87,in _run_code
          exec(code,run_globals)
        File "C:\Users\HP\AppData\Roaming\Python\python38\site-packages\pip\__main__.py",line 23,in <module>
          from pip._internal.cli.main import main as _main  # isort:skip # noqa
        File "C:\Users\HP\AppData\Roaming\Python\python38\site-packages\pip\_internal\cli\main.py",line 5,in <module>
          import locale
        File "C:\Program Files\python38\lib\locale.py",line 16,in <module>
          import re
        File "C:\Program Files\python38\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:\Program Files\python38\python.exe' 'C:\Users\HP\AppData\Roaming\Python\python38\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\HP\AppData\Local\Temp\pip-build-env-j7d0dtw8\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.

解决方法

我认为您应该重新安装python安装或尝试使用其他版本。

,

在得到Hitesh的回答后,我尝试将我的pip版本降级到1.2.1,然后再次安装了它。非常感谢Hitesh Patil!