首页 > 解决方案 > 无法通过 pip install 安装 pyautogui,错误为 1

问题描述

我正在尝试通过代码“pip install pyautogui”安装 pyautogui 但程序总是给我一个错误,如下所示我用管理机构启动了 Visual Studio Code

==================================================== ========================================

(.venv) C:\Users\USer\Desktop\pythoncode>pip install pyautogui
Collecting pyautogui
  Using cached https://files.pythonhosted.org/packages/19/ef/438d80abd396fd2d124bd37c07c765f913723c54197c4c809d85c8ff5a43/PyAutoGUI-0.9.41.tar.gz
Collecting pymsgbox (from pyautogui)
  Using cached https://files.pythonhosted.org/packages/b6/65/86379ede1db26c40e7972d7a41c69cdf12cc6a0f143749aabf67ab8a41a1/PyMsgBox-1.0.6.zip
Collecting PyTweening>=1.0.1 (from pyautogui)
  Using cached https://files.pythonhosted.org/packages/b9/f8/c32a58d6e4dff8aa5c27e907194d69f3b57e525c2e4af96f39c6e9c854d2/PyTweening-1.0.3.zip
Requirement already satisfied: Pillow in c:\users\user\desktop\pythoncode\.venv\lib\site-packages (from pyautogui) (5.4.1)
Collecting pyscreeze (from pyautogui)
  Using cached https://files.pythonhosted.org/packages/f3/27/073bf07400943e38b06ba40def60ec489d114fd7356c2db5a2f793454312/PyScreeze-0.1.19.tar.gz
Collecting pygetwindow (from pyautogui)
  Using cached https://files.pythonhosted.org/packages/01/ed/56d4a369c6e18f6b239d9ef37b3222ba308bfebf949571b2611ff7d64f1d/PyGetWindow-0.0.4.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\USer\AppData\Local\Temp\pip-install-wupkdbtd\pygetwindow\setup.py", line 11, in <module>
    long_description = fh.read()
UnicodeDecodeError: 'cp949' codec can't decode byte 0xe2 in position 903: illegal multibyte sequence

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\USer\AppData\Local\Temp\pip-install-wupkdbtd\pygetwindow\

==================================================== ========================================

我使用 32 位 windows 和 32 位 python 3.7

我已经用代码升级了我的点子pip install --upgrade pip。(当前版本现在是 19.0.2)

我已经尝试了管理权限和类型的提示,pip install pyautogui但提示也给了我同样的错误:

Command "python seup.py egg_info" failed with error code 1 in C:\Users\USer\AppData\Local\Temp\pip-install-e2r19eza\pygetwindow\

我已经尝试了以下链接建议的解决方案,但 “pip install unroll”失败:“python setup.py egg_info”失败,错误代码easy_install -U setuptools1

WinError 5] Access is denied :  'c:\\users\\user\\desktop\\pythoncode\\.venv\\Scripts\\easy_install.exe'

请把你的智慧分享给初学者

标签: pythonwindowspippyautogui

解决方案


尝试以管理员身份安装。

pip install pyautogui

推荐阅读