Python Forum

Full Version: /home/pi/.local/bin is not on PATH
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I installed w1thermsensor and it says that
library /home/pi/.local/bin is not on PATH and I should consider adding it.
Should I add it to $PATH or should I call sys.path.extend(['/home/pi/.local/bin',])
As far as I understand $PATH is for the whole raspberry system and the 'sys.path extend' is for the Python installation only?
Add it to $PATH, for example in the ~/.bashrc file, use
Output:
export PATH="$HOME/.local/bin:$PATH"
$PATH is not related to Python. It is the list of directories where the system looks for executable programs.
(Feb-07-2021, 10:09 PM)Gribouillis Wrote: [ -> ]Add it to $PATH, for example in the ~/.bashrc file, use
Output:
export PATH="$HOME/.local/bin:$PATH"
$PATH is not related to Python. It is the list of directories where the system looks for executable programs.

I installed w1thermsensor and it ended up in directory '/home/pi/.local/bin'. If I'm only going to access w1thermsensor from a Python program wouldn't it be enough to append the directory to sys.path?
From what I read on the web, w1thermsensor is both a CLI tool and a python package. This is often the case with Python libraries that come with an executable program. The CLI program was installed in ~/.local/bin but the Python package was installed in some other place. You don't need to add the bin directory to sys.path. It would be an abnormal configuration. Try this to see where Python stored the library:
import w1thermsensor
print(w1thermsensor)