简体   繁体   English

如何安装PyAutoGUI

[英]How to install PyAutoGUI

I am running OS X El Capitan v. 10.11.3 我正在运行OS X El Capitan v.10.11.3

I am trying to install PyAutoGUI 我正在尝试安装PyAutoGUI

On Terminal, I did the following successfully: 在终端上,我成功执行了以下操作:

sudo pip3 install pyobjc-core  
sudo pip3 install pyobjc

When I tried running "sudo pip3 install pyautogui" I got the following error in Terminal: 当我尝试运行“ sudo pip3 install pyautogui”时,在终端中出现以下错误:

Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-skuvquyu/pyscreeze 命令“ python setup.py egg_info”在/ private / tmp / pip-build-skuvquyu / pyscreeze中失败,错误代码为1

I am not sure what to do about this so if anyone has any advice, I would appreciate it. 我不确定该怎么办,所以如果有人有任何建议,我将不胜感激。

Thanks 谢谢

Found an answer to the problem 找到了问题的答案

On Linux, this is: 在Linux上,这是:

sudo pip3 install python3-xlib

sudo apt-get install scrot

sudo apt-get install python3-tk

sudo apt-get install python3-dev

sudo pip3 install pyautogui

ta daaaa :D ta daaaa:D

Now im using Ubuntu 14.04, but I would try installing the problematic module pyscreeze with: 现在我正在使用Ubuntu 14.04,但是我会尝试使用以下方法安装有问题的模块pyscreeze

sudo pip3 install pyscreeze

I personally got another error about missing module called PIL 我个人遇到另一个有关缺少模块的错误,称为PIL

sudo pip3 install pillow

And then i got some error message about jpeg ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting 然后我得到一些有关jpeg ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting错误消息ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting

I hope you'll have more luck. 我希望你能有更多的运气。

It seems like there's a problem with pip. 点子似乎有问题。 Try reinstalling it. 尝试重新安装它。

It'd be much better if you installed pyautogui directly from github. 如果直接从github安装pyautogui会更好。

Step 1: 第1步:

git clone https://github.com/asweigart/pyautogui

Step 2: 第2步:

cd pyautogui

Step 3: 第三步:

sudo python3 setup.py install

If python3 doesn't work, try python. 如果python3不起作用,请尝试使用python。

This installation error has most likely been fixed as of version 0.9.34. 从0.9.34版本开始,最有可能修复了该安装错误。 The module tried to load the PIL/Pillow module during installation. 该模块尝试在安装过程中加载PIL / Pillow模块。

i have installed pyautogui on my windows : 我在Windows上安装了pyautogui:

  1. I went to my python directory 我去了python目录
  2. There shift + right mouse click and open the command prompt 按住shift键并单击鼠标右键,然后打开命令提示符
  3. Type "python -m pip install pyautogui" (without quotes) 键入“ python -m pip install pyautogui”(不带引号)

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

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