phyton3 pip和pyautogui安装mac-删除损坏的python [英] phyton3 pip and pyautogui install mac -remove broken python

查看:180
本文介绍了phyton3 pip和pyautogui安装mac-删除损坏的python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一年前开始涉足Java开发,现在我通过终端命令奋斗不已,并尝试在其中找到红线.

having jumped into java development a year ago, i now struggle myself thru terminal commands and try to get the red line in it.

我现在想按照本教程设置python3和pyautogui: https://automatetheboringstuff.com/chapter18/

I now want to set up python3 and pyautogui following this tutorial: https://automatetheboringstuff.com/chapter18/

不幸的是,我一直无法设置所需的模块:

unfortunately I keep failing setting up the needed module:

Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-ct_f0rph/pyobjc-core

如果您能帮助我删除旧的python安装,并将python命令链接到python3,我将非常高兴:)

if you please could help me out removing old python installations, and linking python command to python3 i´d be very happy :)

非常感谢!

我的问题是由于缺少xcode,安装它并同意许可使它可以在以下答案中使用

my problem was due to missing xcode, installing it and agreeing license made it work with below answer

在安装pip之后仍然有问题,这是所有仍然遇到问题的解决方案:

still had a problem after installing pip, here is the solve for all who still get problems:

下载推荐文件并在其中运行安装程序,必须打入许多命令才能从适当的目录运行该文件,但最终在导入pyautogui时有效:

download recommended file and run the setup inside, had to punch in many commands to run it from appropiate directory but it finally works when importing pyautogui:

https://www.reddit.com/r/learnpython/related/3z5h0b/trouble_importing_pyautogui_os_x/

ps:我只下载了tar球,并在

ps: i only downloaded the tar ball and used the setup.py inside

推荐答案

下载正确的python 3安装程序: Python3

Download proper installer of python 3: Python3

安装Xcode(从 Xcode 获取).

使用以下命令将xcode-select指向Xcode Developer目录:

Point xcode-select to the Xcode Developer directory using the following command:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

打开命令行并导航到python3目录:

Open command line and navigate to python3 directory:

/Library/Frameworks/Python.framework/Versions/3.5/bin

运行:

sudo pip3 install pyobjc-framework-Quartz
sudo pip3 install pyobjc-core
sudo pip3 install pyobjc
pip3 install pyautogui

从命令行尝试安装,输入:

Try your installation from the command line, type:

python3
import pyautogui

如果一切正常,则不会出现导入错误. 希望对您有帮助.

If everything is fine you won't have an import error. I hope it helps.

这篇关于phyton3 pip和pyautogui安装mac-删除损坏的python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆