MouseInfo (version 0.1.3) is a utility application that displays the XY coordinates of the mouse cursor and the RGB color information of the pixel beneath it. Designed for GUI automation planning, it functions across Windows, macOS, and Linux. The project is bundled with `PyAutoGUI` and appears to be in maintenance mode, with its last PyPI update in March 2020.
pip install mouseinfoVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to launch the MouseInfo GUI application using Python. The application provides a live display of the mouse cursor's XY coordinates and the RGB color value of the pixel underneath. It will block the Python shell until the GUI window is closed. For a non-blocking experience or direct coordinate/color retrieval in scripts, users typically integrate with `PyAutoGUI`'s `position()` and `pixel()` functions, which `MouseInfo` is often used to plan for.
Use a separate process or thread if you need to run MouseInfo concurrently with other Python code. Alternatively, run it directly from the command line (`python3 -m mouseinfo`) for interactive use without blocking your script.
Ensure `Pillow` (PIL) is correctly installed (`pip install Pillow`). System-specific workarounds or ensuring correct display permissions might be necessary. Some users report issues persist even with `Pillow` installed.
Always use MouseInfo with Python 3.x for stability, security, and access to modern Python features.
Ensure `mouseinfo` is installed in the correct environment by running `pip install mouseinfo`. On macOS/Linux, use `pip3 install mouseinfo`. If multiple Python versions are present, use `python3 -m pip install mouseinfo` or `py -m pip install mouseinfo` on Windows to target a specific interpreter.
Run your script in a graphical environment on Windows, macOS, or a Linux desktop with an X server. If using WSL, ensure an X server (like VcXsrv or X410) is installed and configured on Windows, and the `DISPLAY` environment variable is set correctly in your WSL terminal. Alternatively, avoid using `mouseinfo` functions in headless environments if GUI interaction is not required.
On Debian/Ubuntu-based Linux systems, install `tkinter` by running `sudo apt-get install python3-tk` (for Python 3). On Arch Linux, use `sudo pacman -S tk`. Other distributions will have similar package names for `tkinter` or `python-tk`.
Ensure Python and pip are correctly installed and added to your system's PATH. On most systems, `python3` and `pip3` are the standard commands for Python 3. You can also explicitly call pip using `python3 -m pip install mouseinfo` or `py -m pip install mouseinfo` on Windows.