python3使用pip安装pyautogui过程中遇到的几个问题

最近想要做一个模拟鼠标点击的小程序(具体原因不说了哈:)),就想到使用python,上网搜了一下,很多都使用pyautogui这个库的,于是就想要安装pyautogui,但是过程中遇到了几个坑,写此博记录一下,当然也很高兴可以为看到此博的你解决同样的问题。

先写一下自己的环境:操作系统windows7 64位,python版本python-3.7.0-amd64,安装方式pip。OK,下面就开始逐条列举所遇问题及解决方法。

1.运行pip install pyautogui后出现如下错误(黄字):

Collecting pyautogui
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None))
 after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFI
CATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certif
icate (_ssl.c:1045)'))': /simple/pyautogui/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None))
 after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFI
CATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certif
icate (_ssl.c:1045)'))': /simple/pyautogui/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None))
 after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFI
CATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certif
icate (_ssl.c:1045)'))': /simple/pyautogui/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None))
 after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFI
CATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certif
icate (_ssl.c:1045)'))': /simple/pyautogui/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None))
 after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFI
CATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certif
icate (_ssl.c:1045)'))': /simple/pyautogui/
  Could not fetch URL https://pypi.org/simple/pyautogui/: There was a problem co
nfirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Ma
x retries exceeded with url: /simple/pyautogui/ (Caused by SSLError(SSLCertVerif
icationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: una
ble to get local issuer certificate (_ssl.c:1045)'))) - skipping
  Could not find a version that satisfies the requirement pyautogui (from versio
ns: )
No matching distribution found for pyautogui
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming
 the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retrie
s exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1
, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get loc
al issuer certificate (_ssl.c:1045)'))) - skipping

这个问题比较坑,看log应该是https鉴权,于是上网找了各种方法,都不行,重装python,重启电脑,修改电脑时间都不行,最后发现是自己在调式其他东西打开了fiddler,关闭fiddler就好了,这个是被自己坑了。

 

2.继续运行pip install pyautogui后提示You are using pip version 10.0.1, however version 19.0.1 is available.

这个是pip版本低了,根据提示运行python -m pip install --upgrade pip即可。

 

3.继续运行pip install pyautogui出现错误:

  Using cached https://files.pythonhosted.org/packages/01/ed/56d4a369c6e18f6b239
d9ef37b3222ba308bfebf949571b2611ff7d64f1d/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\80237102\AppData\Local\Temp\pip-install-m1k3v484\pygetwindo
w\setup.py", line 11, in <module>
        long_description = fh.read()
    UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 905: ille
gal multibyte sequence

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

这个错误是安装pyautogui过程中遇到的一个核心错误,是安装PyGetWindow过程中出现的,网上搜了一通,最后试了各种方法,就是降低PyGetWindow版本,默认安装的PyAutoGUI-0.9.41,依赖的是PyGetWindow-0.0.4,就是这个PyGetWindow-0.0.4导致了上述问题,于是网上大神说降低PyGetWindow版本,运行pip install PyGetWindow==0.0.1后安装PyGetWindow成功,然后再运行pip install pyautogui,这次,欧耶,成功了。

  • 36
    点赞
  • 49
    收藏
    觉得还不错? 一键收藏
  • 30
    评论
当在安装pyautogui遇到subprocess-exited-with-error错误,这通常表示在运行pip命令时遇到了一个或多个子进程出错的情况。这可能是由于与操作系统或Python版本相关的错误导致的。 为了解决这个问题,有几个步骤可以尝试: 1. 确保你的Python环境已经正确地安装和配置。你可以通过运行"python --version"来检查Python的版本号,并确保它是你期望的版本。 2. 确保你的pip工具是最新版本。你可以运行"pip install --upgrade pip"来升级pip工具。 3. 尝试升级setuptools工具。你可以运行"pip install --upgrade setuptools"来更新setuptools。 4. 如果上述步骤都没有解决问题,你可以尝试使用虚拟环境来安装pyautogui。你可以通过运行以下命令来安装virtualenvwrapper工具: "pip install virtualenvwrapper" 这些步骤的每一个都可能有助于解决subprocess-exited-with-error错误。请根据你的具体情况尝试以上方法,并确保你按照正确的步骤进行操作。希望这能帮到你!<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [pip intall 出现 error: subprocess-exited-with-error 错误的解决办法](https://blog.csdn.net/Jackfled/article/details/127046255)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *3* [pip安装软件包报错: error subprocess-exited-with-error问题记录](https://blog.csdn.net/weixin_53742691/article/details/130931339)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 30
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值