ModuleNotFoundError:没有名为“ Quartz”的模块

我正在尝试在python3上使用Mac。我已经安装了pyobjc-core和pyobjc,但未显示错误Quartz。我对这种安装非常陌生。有什么解决办法吗?


这是我来自pycharm的错误:


Traceback (most recent call last):

  File "/Users/Thyme/PycharmProjects/DinosourBot/venv/lib/python3.6/site-packages/pyautogui/_pyautogui_osx.py", line 5, in <module>

    import Quartz

ModuleNotFoundError: No module named 'Quartz'


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "/Users/Thyme/PycharmProjects/DinosourBot/Bot.py", line 2, in <module>

    import pyautogui

  File "/Users/Thyme/PycharmProjects/DinosourBot/venv/lib/python3.6/site-packages/pyautogui/__init__.py", line 110, in <module>

    from . import _pyautogui_osx as platformModule

  File "/Users/Thyme/PycharmProjects/DinosourBot/venv/lib/python3.6/site-packages/pyautogui/_pyautogui_osx.py", line 7, in <module>

    assert False, "You must first install pyobjc-core and pyobjc: https://pyautogui.readthedocs.io/en/latest/install.html"

AssertionError: You must first install pyobjc-core and pyobjc: https://pyautogui.readthedocs.io/en/latest/install.html


Process finished with exit code 1


阿波罗的战车
浏览 700回答 3
3回答

收到一只叮咚

如果有人在这里跌跌撞撞,请使用:pip&nbsp;install&nbsp;pyobjc-framework-Quartz

达令说

我已经通过安装pycharc-framework-Quartz解决了这个问题,它是由pycharm提供的

交互式爱情

我建议最好安装所有的pyObjC,而不是仅安装特定的框架。始终,如果您正在使用Quartz,那么至少将需要各种CoreFoundation对象和常量。更不用说AppKit或其他框架了,这取决于您在做什么。pip install pyobjc(或pip3)应该安装一切并让您import Quartz。(它对我来说适用于几个python!)
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python