Skip to content

[BUG] ImportError while installing the (pre-release) package on macOS #131

@lnxpy

Description

@lnxpy

When I'm trying to install the package on macOS Ventura 13.4.1, I get the following exception.

$ pip install git+https://github.com/boppreh/mouse.git

Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "<pip-setuptools-caller>", line 34, in <module>
  File "/private/tmp/mouse/setup.py", line 7, in <module>
    import mouse
  File "/private/tmp/mouse/mouse/__init__.py", line 57, in <module>
    from. import _darwinmouse as _os_mouse
  File "/private/tmp/mouse/mouse/_darwinmouse.py", line 6, in <module>
    import Quartz
ModuleNotFoundError: No module named 'Quartz'

My solution

That's basically because you're importing mouse in setup.py. It actually triggers the __init__.py to run and in the OS condition during the installation process, it tries to from. import _darwinmouse as _os_mouse which needs Quartz (which is one of the dependencies) to be already installed.

To fix the issue, simply remove import mouse line from setup.py and satisfy the values of version and long_description from another source out of the mouse/ directory. Or you can read the actual context of <package>/<package>/__init__.py file and apply a RegEx pattern to find out the value of version from within the setup.py file which I don't recommend.

Both solutions will fix the issue for Mac users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions