phyton3 pip and pyautogui install mac -remove broken python [closed]

隐身守侯 提交于 2019-12-11 00:31:53

问题


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

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

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

thanks a lot!

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

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

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: i only downloaded the tar ball and used the setup.py inside


回答1:


Download proper installer of python 3: Python3

Install Xcode (get it from Xcode) if you don't have it yet.

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

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

Open command line and navigate to python3 directory:

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

Run:

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.



来源:https://stackoverflow.com/questions/35051580/phyton3-pip-and-pyautogui-install-mac-remove-broken-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!