Python Forum
/home/pi/.local/bin is not on PATH - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: /home/pi/.local/bin is not on PATH (/thread-32408.html)



/home/pi/.local/bin is not on PATH - hcccs - Feb-07-2021

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?


RE: /home/pi/.local/bin is not on PATH - Gribouillis - Feb-07-2021

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.


RE: /home/pi/.local/bin is not on PATH - hcccs - Feb-08-2021

(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?


RE: /home/pi/.local/bin is not on PATH - Gribouillis - Feb-08-2021

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)