简体   繁体   English

安装pyautogui的问题

[英]Problems to install pyautogui

I am having problems to install pyautogui.我在安装 pyautogui 时遇到问题。 I have installed Python, Pip and Anaconda in my notebook, but when I try to install pyautogui using the code within cmd: pip install pyautogui I have the return bellow:我已经在我的笔记本中安装了 Python、Pip 和 Anaconda,但是当我尝试使用 cmd 中的代码安装 pyautogui 时: 881334444827288 install pyautogui 我有以下返回:

WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)'))': /simple/pyautogui/ Could not fetch URL https://pypi.org/simple/pyautogui/ : There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pyautogui/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)'))) - skipping ERROR: Could not find a version that satisfies the requirement pyautogui (from versions: none) ERROR: No matching distribution found for pyautogui警告:重试(重试(total=0,connect=None,read=None,redirect=None,status=None))连接被'SSLError(SSLCertVerificationError(1,'[SSL:CERTIFICATE_VERIFY_FAILED]证书验证失败:无法获取本地颁发者证书 (_ssl.c:1108'))': /simple/pyautogui/ 无法获取 URL https://pypi.org/simple/pyautogui/ : 确认 ssl 证书时出现问题:HTTPSConnectionPool(host ='pypi.org', port=443): Max retries exceeded with url: /simple/pyautogui/ (由 SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl .c:1108)'))) - 跳过错误:找不到满足pyautogui要求的版本(来自版本:无)错误:找不到pyautogui的匹配分布

Someone could help me, please?有人可以帮助我吗?

It really depends on your setup, but here are a few things that might help:这实际上取决于您的设置,但以下几点可能会有所帮助:

  • Generally, when you're installing a package, you go to the command prompt and type something like python -m pip install pyautogui ;通常,当您安装 package 时,您 go 到命令提示符并键入类似python -m pip install pyautogui python is written here to tell the command prompt you're using the python language, -m tells it to look for a module (in this case pip) rather than some script file name, and pip install pyautogui means you're trying to install a module called pyautogui python写在这里告诉命令提示符你正在使用 python 语言, -m告诉它寻找一个模块(在本例中是 pip)而不是一些脚本文件名, pip install pyautogui意味着你正在尝试安装一个名为 pyautogui 的模块
  • Pip looks in a few specific places for modules. Pip 在几个特定的地方寻找模块。 If it doesn't find them there, it lets you know they were not found.如果在那里没有找到它们,它会让您知道没有找到它们。 If the module you're trying to install can't be found, generally you'll want to hunt down an actual file for it and install it with that file.如果找不到您要安装的模块,通常您需要为它寻找一个实际文件并使用该文件安装它。 However, I know it can find pyautogui, because I just installed it yesterday!但是,我知道它可以找到 pyautogui,因为我昨天才安装它!
  • If you're using a Jupyter Notebook within Anaconda, which it sounds like you are, you may not actually want to use your computer's command prompt.如果您在 Anaconda 内使用 Jupyter Notebook,您可能实际上不想使用计算机的命令提示符。 Your computer may be finding a different version of Python than your Anaconda installation.您的计算机找到的 Python 版本可能与您安装的 Anaconda 版本不同。 So, if you want to be able to use pyautogui in Anaconda, you'll want to follow these steps:所以,如果你想在 Anaconda 中使用 pyautogui,你需要按照以下步骤操作:
    1. Open Anaconda Navigator打开 Anaconda 导航器
    2. Launch the CMD.exe prompt in the Navigator, which is set up to deal with the Anaconda installation在 Navigator 中启动 CMD.exe 提示符,设置为处理 Anaconda 安装
    3. Type pip install pyautogui in this window and hit enter输入pip install pyautogui in this window 然后回车

I'm not sure about this, but i had the same problem while creating a discord bot with discord.py, what i ended doing was downloading an SSL certificate from a website( search on google there are a bunch of them) then opening the download and it automatically sets it up.我对此不确定,但我在使用 discord.py 创建 discord 机器人时遇到了同样的问题,我最后做的是从网站下载 SSL 证书(在谷歌上搜索有很多)然后打开下载并它会自动设置它。 And that fixed the problem for me.这为我解决了问题。

Try this command pip3 install --trusted-host pypi.org --trusted-host files.pythonhosted.org pyautogui试试这个命令pip3 install --trusted-host pypi.org --trusted-host files.pythonhosted.org pyautogui

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM