TWolczanski / linux-autoscroll

A simple Python script for Windows-like autoscroll experience on Linux.
GNU General Public License v3.0
54 stars 8 forks source link

Problem With Use on Arch Linux #15

Closed xelathing closed 2 years ago

xelathing commented 2 years ago

I followed install directions as normal, replacing Ubuntu's commands with Arch's. Everything is fine up until a point.

Arch doesn't work with "python3-dev", so I was unable to install it as preparation. All Python libraries reported to have installed correctly.

However, upon trying to run the finished script nothing happens. Running it in Konsole reports:

Traceback (most recent call last): File "/home/xela/linux-autoscroll/autoscroll.py", line 4, in from pynput.mouse import Button, Controller, Listener ModuleNotFoundError: No module named 'pynput'

I am unsure how to move past this point, if I am able to. I am extremely new to Arch Linux so I don't have the skills to figure out why Python cannot use pynput. The following is an attempt to reinstall the necessary libraries. autoscroll.py still doesn't function due to the same error shown above.

[xela@archlinux ~]$ python3 -m pip install wheel python3 -m pip install pynput python3 -m pip install PyQt5 Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: wheel in /usr/lib/python3.10/site-packages (0.37.1) Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: pynput in ./.local/lib/python3.10/site-packages (1.7.6) Requirement already satisfied: six in /usr/lib/python3.10/site-packages (from pynput) (1.16.0) Requirement already satisfied: evdev>=1.3 in ./.local/lib/python3.10/site-packages (from pynput) (1.5.0) Requirement already satisfied: python-xlib>=0.17 in ./.local/lib/python3.10/site-packages (from pynput) (0.31) Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: PyQt5 in /usr/lib/python3.10/site-packages (5.15.7) Requirement already satisfied: PyQt5-sip<13,>=12.11 in /usr/lib/python3.10/site-packages (from PyQt5) (12.11.0) [xela@archlinux ~]$

TWolczanski commented 2 years ago

Hi, it looks like you hadn't activated the Python virtual environment before installing the packages and installed them globally (from what you've pasted I can infer that they are installed in ./.local/lib and /usr/lib). The Python interpreter specified in the shebang simply doesn't see the libraries and throws an error. What you can do is uninstall the packages from the global interpreter and install them once again, but this time run the second command from the 2nd point of the installation instructions beforehand:

python3 -m pip uninstall wheel pynput PyQt5
source .autoscroll/bin/activate
python3 -m pip install wheel pynput PyQt5

Note that you have to be inside the directory where you've created your virtual environment before issuing the second command and that after running the command your prompt should contain the name of the virtual environment (for example (.autoscroll) [xela@archlinux ~]$).