question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ModuleNotFoundError: No module named 'Quartz' on Mac

See original GitHub issue

The dependency (pyobjc) is not being installed as part of pip install keyboard:

$ python3 -m venv venv_keyboard

$ source venv_keyboard/bin/activate

(venv_keyboard) $ pip install keyboard
Collecting keyboard
  Using cached keyboard-0.11.0-py2.py3-none-any.whl
Installing collected packages: keyboard
Successfully installed keyboard-0.11.0

(venv_keyboard) $ python
Python 3.6.4 (default, Mar  1 2018, 18:36:50) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

>>> import keyboard
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/jakubczaplicki/PycharmProjects/venv_keyboard/lib/python3.6/site-packages/keyboard/__init__.py", line 103, in <module>
    from. import _darwinkeyboard as _os_keyboard
  File "/Users/jakubczaplicki/PycharmProjects/venv_keyboard/lib/python3.6/site-packages/keyboard/_darwinkeyboard.py", line 3, in <module>
    import Quartz
ModuleNotFoundError: No module named 'Quartz'
>>> 

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bopprehcommented, Mar 29, 2018

Found the problem. The setuptools package on the system used to build the release was outdated (Windows pip vs Windows-Ubuntu pip), and the result was unconditional dependencies. More details in the commit message: 083b78f

I’m finishing some changes and will release a new-new version with the dependency declaration correct. I’m keeping the issue open until then, since it can’t be really fixed until a release is launched.

Sorry for the absolute mess.

1reaction
bopprehcommented, Mar 29, 2018

Note I had to undo https://github.com/boppreh/keyboard/blob/6f9961f2589cf37749239acf938a7e40ae9e9a21/setup.py#L34 because it broke installation on Windows and Linux (#143).

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: No module named 'Quartz'
I'm trying to work on python3 and using mac. I have installed pyobjc-core and pyobjc, but the error said Quartz not found.
Read more >
ImportError: No module named Quartz - Mac OSX #13 - GitHub
Hm running objc from the python command line seems fine I think? /usr/local/bin/python. import objc print dir(objc). ['Accessor ...
Read more >
No module named Quartz - Workflow Help & Questions
I am using a Python Script that someone else wrote to control the macOS Media keys for music playback. It stopped working in...
Read more >
pyobjc-framework-Quartz - PyPI
Wrappers for the “Quartz” related frameworks on macOS. These frameworks provide a number of graphics related API's. The frameworks wrapped by this package...
Read more >
“import Quartz” or “import CoreGraphics” - PyObjC
“import CoreGraphics”. Apple ships a module named CoreGraphics that provides bindings for a large subset of the CoreGraphics API. · “import Quartz”. PyObjC...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found