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

Thy*_*e N 6 python python-3.x

我正在尝试在 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
Run Code Online (Sandbox Code Playgroud)

小智 7

如果有人在这里绊倒,请使用:

pip install pyobjc-framework-Quartz
Run Code Online (Sandbox Code Playgroud)


Thy*_*e N 3

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