Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4874

Python • Re: DS18B20 / w1thermsensor

$
0
0
"this environment is externally managed".means you are executing the command in a terminal with the venv not activated.
I actually was executing the pip with the venv activated. I had created the venv without copying over the main package distribution. So I recreated it doing that copy-over and then the install succeeded. It gave a warning that the package had been installed in /home/pi/.local/bin and I should add that to my $PATH., which I did.

Strange (at least to this Linux noob) is that now my Python programs that use the sensor work WITHOUT having the venv activated. (???) It's like the venv was only needed for the install. Does that make sense?

I look in /home/pi/.local/bin and the only file there is: w1thermsensor, of type plain text, and here is what it contains:

Code:

#!/home/pi/Documents/HVAC/env/bin/python# -*- coding: utf-8 -*-import reimport sysfrom w1thermsensor.cli import cliif __name__ == '__main__':    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])    sys.exit(cli())
I'm glad it works but sure don't understand it!

Statistics: Posted by dlflannery — Wed Jul 31, 2024 6:56 pm



Viewing all articles
Browse latest Browse all 4874

Trending Articles