gpt4 book ai didi

python - pip3 install pyautogui 失败,错误代码为 1 Mac OS

转载 作者:太空宇宙 更新时间:2023-11-03 14:13:54 27 4
gpt4 key购买 nike

我尝试安装 autogui python 扩展:

pip3 install pyautogui

此安装尝试导致以下错误消息:

Collecting pyautogui
Using cached PyAutoGUI-0.9.33.zip
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/00/zcr6mkx90hg7kr4x_ks6nhhw0000gn/T/pip-build-edy15oyn/pyautogui/setup.py", line 6, in <module>
version=__import__('pyautogui').__version__,
File "/private/var/folders/00/zcr6mkx90hg7kr4x_ks6nhhw0000gn/T/pip-build-edy15oyn/pyautogui/pyautogui/__init__.py", line 110, in <module>
from . import _pyautogui_osx as platformModule
File "/private/var/folders/00/zcr6mkx90hg7kr4x_ks6nhhw0000gn/T/pip-build-edy15oyn/pyautogui/pyautogui/_pyautogui_osx.py", line 4, in <module>
import Quartz
File "/usr/local/lib/python3.5/site-packages/Quartz/__init__.py", line 5, in <module>
import objc
File "/usr/local/lib/python3.5/site-packages/objc/__init__.py", line 18, in <module>
_update()
File "/usr/local/lib/python3.5/site-packages/objc/__init__.py", line 15, in _update
import objc._objc as _objc
ImportError: dlopen(/usr/local/lib/python3.5/site-packages/objc/_objc.cpython-35m-darwin.so, 2): Symbol not found: _PyObject_REPR
Referenced from: /usr/local/lib/python3.5/site-packages/objc/_objc.cpython-35m-darwin.so
Expected in: flat namespace
in /usr/local/lib/python3.5/site-packages/objc/_objc.cpython-35m-darwin.so

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/00/zcr6mkx90hg7kr4x_ks6nhhw0000gn/T/pip-build-edy15oyn/pyautogui

我的 Mac OS 版本是 OS X El Capitan 10.11.3,我的 Python3 版本是 3.5.1,我的 pip3 版本是 pip 8.0.2。

在 Stackoverflow ( Cannot install pip install pyautogui, error code 1 ) 上似乎有一个类似的问题,但修复不适用于我的问题;我已经安装了“枕头”。另外,我已经阅读了文档(https://pypi.python.org/pypi/PyAutoGUI),并安装了 pyobjc-core 和 pyobjc。安装工具已安装并且是最新的。

有谁知道如何修复此错误(并安装 pyautogui)?我认为错误可能起源于 _PyObject_REPR is missing in Python 3.5.1 .

最佳答案

我找到了 a workaround . “Kentzo”的这段代码为我解决了这个问题:

pip3 install https://github.com/GreatFruitOmsk/pyobjc-core/releases/download/v3.0.5.dev0/pyobjc-core-3.0.5.tar.gz

由于代码不是我写的,请自行承担使用此变通方法的风险。

关于python - pip3 install pyautogui 失败,错误代码为 1 Mac OS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35074294/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com