powerupp icon indicating copy to clipboard operation
powerupp copied to clipboard

pip on Arch

Open venomousZealot opened this issue 4 years ago • 2 comments

I just spent the evening learning about "pip" and I am not happy.

To my fellow arch users, please do NOT use pip system-wide. There is also no need to install pip as a package. The pip command becomes available once you activate a virtual python environment.

Quote from ArchWiki:

If you must use pip, use a virtual environment, or pip install --user to avoid conflicts with packages in /usr.

I'm no expert, but here is how I got the pip dependencies to work:

python -m venv upp_venv
source upp_venv/bin/activate
pip install upp
deactivate

Then launch powerupp with a custom path.

PATH="$HOME/upp_venv/bin:$PATH" powerupp

I haven't yet given the udev rule a thought.

venomousZealot avatar May 02 '20 21:05 venomousZealot

I have no experience with Python virtual environemnt but pip install --user is probably a better option in this case (and I should change the readme...). Powerupp checks PATH for upp and also the directory ~/.local/bin (which is not in PATH on some systems but (sometimes) used by pip) and temporarily adds it to PATH if necessary, and sets up the udev rule accordingly. If the virtual environment is not available at system start that is of course harder to work around.

azeam avatar May 02 '20 22:05 azeam

There is nothing wrong with pip, but of course one should be careful not to mess up the distro package files in root mode. To use upp deployed in --user mode with sudo, provided that the ~/.local/bin is in path, try: sudo -E env "PATH=$PATH" upp --help

sibradzic avatar May 03 '20 05:05 sibradzic