python安装pyautogui遇到的"gbk"异常解决

一开始使用pip install pyautogui,报错,大概信息如下:

Collecting pygetwindow (from pyautogui)
  Using cached https://files.pythonhosted.org/packages/01/ed/56d4a369c6e18f6b239d9ef37b3222ba308bfebf949571b2611ff7d64f1d/PyGetWindow-0.0.4.tar.gz
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\lsw_p\AppData\Local\Temp\pip-install-n9ekvbwf\pygetwindow\setup.py", line 11, in <module>
        long_description = fh.read()
    UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xa2 in position 905: illegal multibyte sequence
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in C:\Users\lsw_p\AppData\Local\Temp\pip-install-n9ekvbwf\pygetwindow\

然后使用下载了pyautogui对应的包再安装,还是报这个错

最后看了一篇大神的博客,成功解决了这个问题:

1.首先执行:  pip install PyGetWindow==0.0.1
执行过程中可能会报错,但是没关系,不用管,我这边打印的信息如下:
Collecting PyGetWindow==0.0.1
  Downloading https://files.pythonhosted.org/packages/66/93/1229fa064cef5081b06a41512085ca590b93ac949e0af82341a488a4f596/PyGetWindow-0.0.1.tar.gz
Building wheels for collected packages: PyGetWindow
  Building wheel for PyGetWindow (setup.py) ... done
  Stored in directory: C:\Users\lsw_p\AppData\Local\pip\Cache\wheels\2f\e2\4b\af020e98d7d3e76018ac9e7c420c3d37e1baca0904e3f5dbb5
Successfully built PyGetWindow
ERROR: pyautogui 0.9.42 requires Pillow, which is not installed.
ERROR: pyautogui 0.9.42 requires pymsgbox, which is not installed.
ERROR: pyautogui 0.9.42 requires pyscreeze>=0.1.20, which is not installed.
ERROR: pyautogui 0.9.42 requires PyTweening>=1.0.1, which is not installed.
Installing collected packages: PyGetWindow
Successfully installed PyGetWindow-0.0.1
2.接着再执行: pip install pyautogui,你就会发现,这次可以成功安装了.

原文地址:https://www.cnblogs.com/lswzt/p/10845753.html

时间: 2024-11-09 05:16:19

python安装pyautogui遇到的"gbk"异常解决的相关文章

python安装markupsafe模块时卡死的解决办法

起因: 升级OS X从10.8到10.9,会发现在安装python的markupsafe模块时一直卡住. 当时的机器环境是: OSX 10.9, XCode 4.6.2, Python 2.7.6, Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) 界面一直停留在下面的情况 mbp:MarkupSafe-0.23 $ python setup.py install running install running bdis

python安装pyautogui

一.问题在安装使用[pip install pyautogui]的时候会出现如下的错误: ERROR: Complete output from command python setup.py egg_info: ERROR: Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\14276\AppData\Local\Temp\pi

linux环境手动编译安装Nginx实践过程 附异常解决

1.下载nginx源码包并解压 可在http://nginx.org/en/download.html下载.tar.gz的源码包,如(nginx-1.4.7.tar.gz) 或者使用云盘下载   http://url.cn/5kRqr3n   (密码:f72dcD) 下载后通过tar -xvzf 进行解压,解压后的nginx目录结构如下: 2.为nginx设置安装目录和启用的模块 切换到解压后的nginx目录中执行: ./configure --prefix=/opt/demo/nginx --

Python 安装pyautogui

在Python中使用PyAutoGui模拟键盘和鼠标操作 一.系统环境 操作系统:win10 64位 Python版本:Python 3.7.0 二.安装参考 1.使用pip进行安装,pip install pyautogui 在我这台机器上未能成功安装 2.下载后安装 网址: https://pypi.org/project/PyAutoGUI 点Download files,下载右侧的PyAutoGUI-0.9.38.tar.gz 解压后,进入解压目录执行python setup.py in

Python 安装Scrapy报错(已解决)

error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools 进入该网址http://www.lfd.uci.edu/~gohlke/pythonlibs/#twisted 下载twisted对应版本的whl文件   Twisted-17.1.0-

Python: 安装 sklearn 包出现错误的解决方法

今天在安装python 的 sklearn 包时出现了 Cannot uninstall 'numpy' 和 Cannot uninstall 'scipy' 错误,下面记录了我尝试了很多网上的方法后最终成功的解决方法. 终端执行 pip install scikit-learn 后,出现 Cannot uninstall 'numpy'. It is a distutils installed project and thus we cannot accurately determine wh

python 安装 pyautogui 报错

pip install --user --upgrade setuptools python -m pip install --user --upgrade pip pip install --user pyautogui 原文地址:https://www.cnblogs.com/java-xz/p/11203371.html

python升级pip命令版本的异常解决

正常输入升级命令: python -m pip install --upgrade pip 弹出报错及提示: 意思很明显就是当前用的权限不够修改/删除目标文件. 此时就要赋予当前操作用户一定权限才能正常升级,步骤如下 当前用户下找到python的安装目录 右击--属性--安全,在用户组和用户名中找到对应的当前操作用户,点击编辑 点击编辑后弹出对话框 同样选择当前的操作用户,在User权限中选择完全控制,点击应用--确认. 原文地址:https://www.cnblogs.com/gegepahe

python安装pyautogui时遇到Pillow问题

执行   pip install pyautogui 提示: Could not find a version that satisfies the requirement Pillow>=6.2.1 (from pyscreeze>=0.1.21->pyautogui) (from versions: none) 参考:https://www.jianshu.com/p/3de67550cea6     ,首先从 https://www.lfd.uci.edu/~gohlke/pyth