Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lnxpy opened this issue Jul 18, 2023 · 1 comment
Open

Comments

@lnxpy
Copy link

lnxpy commented Jul 18, 2023

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.

@JerryWeii-27
Copy link

Thank you for the solution! I ran into this trouble as well, and I solved it by simply replacing the version with '0.7.1' and commenting out the long_description line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants