Can't run/install Python script

I installed Manjaro KDE on my new PC and I’m trying to install this now:

It makes the mouse wheel experience on Linux infinitely better. I have installed it many times on Debian/Ubuntu based distros with no problems.

According the instructions one should do:
pip install -r requirements.txt
(I used pip3 instead - the result is the same)

But I get this message:
Mod edit: Removed a picture of text. See: [HowTo] Post command output and file content as formatted text

I’m not sure what it means nor how to solve it.
Any input would be appreciated.

If you wish to install a non-Arch-packaged Python package, create a virtual environment using ‘python -m venv path/to/venv’. Then use path/to/venv/bin/python and path/to/venv/bin/pip.

:arrow_down:

cd mouse-scroll-wheel-acceleration-userspace
python -m venv venv
source venv/bin/activate

Now do your pip stuff in a virtual environment and not globally. We saw lot of users who have conllicts between pacman and pip, since they use the same folders as root. Then people come and say: “Oh pacman/pamac cannot upgrade! Plz Halp” etc. Please avoid that. The error, which was introduced upstream by pip devs, should be clear.

Since the script is a user space implementation, it should not need to have root access. User mode is more than enough.

3 Likes

Thanks for detailed explanation!
The installation itself works with those instructions, but the service doesn’t seem to be able to start/run:

systemctl restart --user mouse-scroll-wheel-accelerator

No errors or output, but it’s not starting. I assume it has something to do with that venv?

You are correct.

The environment needed for the service is not available.

1 Like

Thanks for confirming, so how can I get around that?
I really would like to run that “wheel mod” somehow.

Well just a bit searching… example: How to create a systemd service for python script with virtualenv · GitHub

Edit it:

systemctl --user edit --full mouse-scroll-wheel-accelerator.service

and change it something like that:

[Unit]
Description=Mouse scroll wheel accelerator

[Service]
WorkingDirectory=/tmp/mouse-scroll-wheel-acceleration-userspace/
Environment=PYTHONPATH=/tmp/mouse-scroll-wheel-acceleration-userspace/
ExecStart=/tmp/mouse-scroll-wheel-acceleration-userspace/venv/bin/python main.py
Type=simple
Restart=always

[Install]
WantedBy=default.target

Adjust the paths to your needs.

1 Like

It now works!
Thank you so much!!

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.