Re: [weewx-user] Using venv for weewx 5.0

2024-06-15 Thread Chuck Rhode
On Fri, 14 Jun 2024 14:38:59 -0700 (PDT)
vince  wrote:

> install ... prerequisite module(s) ... with pip just like you did
> for v4

I note that Debian (and presumably downstream) packaging for the
*python* development and run-time environments changed in v12
(Bookworm).  The package *python3-pip* exists alike in v11 (Bullseye)
and v12 (Bookworm), but, whereas *pip* was installed by default as
part of *python* in v11 (Bullseye), in v12 (Bookworm) it is not.  It
must be installed via the above package, and *pip* will not actually
run outside a virtual environment.  This is to avoid conflicts between
what *apt* installs in the Debian system environment and what *pip*
installs in whatever environment.

... so *pip* installations in virtual environments, being good things,
are being enforced, too.  *WeeWX*'s installation instructions for
*pip* in virtual environments (and for *apt* system-wide installations
for that matter) seem correct.

I believe I'm right in saying that *pip* is no longer packaged with
*python*, but I can't find any good, concise summary of the situation
in *python* release notes, Debian release notes, or on the 'Net.
MEGO, looking

But see:  file:///usr/share/doc/python3.11/README.venv

... if you have python3.11 installed.

Or look at:
https://www.debian.org/releases/stable/amd64/release-notes/ch-information.en.html#python3-pep-668

These documents don't, IMNSHO, give background or much explanation and
their prescriptions seem a trifle "over defined."

-- 
.. Be Seeing You,
.. Chuck Rhode, Sheboygan, WI, USA
.. Weather:  http://LacusVeris.com/WX
.. 65° — Wind ESE 10 mph

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/20240615110505.156f07ba%40BigTimber.LacusVeris.com.


Re: [weewx-user] Using venv for weewx 5.0

2024-06-14 Thread vince
Easy.  Everything goes inside the venv.   Activate your venv (likely 
'source /home/pi/weewx-venv/bin/activate') then install and configure the 
MQTTSubscribe extension and also install its prerequisite module paho-mqtt 
with pip just like you did for v4.  Other than the one added step to 
activate the venv the other real difference in v5 is that it is now "weectl 
extension install" not the old wee_extension command to install any skins 
or extensions via the extension installer.

https://weewx.com/docs/5.0/upgrade/#upgrading-to-v50 has the changes worth 
noting.

On Friday, June 14, 2024 at 1:59:28 PM UTC-7 bgra...@umw.edu wrote:

> Vince,
> I've been using Node-Red to send MQTT data from several other sensors to 
> weewx 4.10.2 on Ubuntu (VP2)--all working ok. I'm now trying to setup the 
> same install on an RPI5 which is running weewx 5.0. Being unfamiliar with 
> venv, I'm trying to understand what goes inside and outside of the virtual 
> environment. Thanks.
> Bob
>
> On Friday, June 14, 2024 at 11:30:21 AM UTC-4 vince wrote:
>
>> What are you actually trying to do with node-red ?  Not seeing what it 
>> has to do with weewx.   Are you trying to use it to read other sensors or 
>> something like that ?
>>
>> On Friday, June 14, 2024 at 7:30:34 AM UTC-7 Tom Keffer wrote:
>>
>>> A virtual environment is just a way of isolating a Python-based runtime. 
>>> The environment locks down which instance of the Python interpreter will be 
>>> used, plus that interpreter gets its own copy of any installed Python 
>>> modules. 
>>>
>>> Node Red uses the node interpreter, not the Python interpreter. You 
>>> install it using a node tool such as npm. Just install it as per their 
>>> instructions. Same with installing it as a systemd service.
>>>
>>> The two systems are really completely independent of each other. 
>>>
>>> I'm not sure I've answered your question. If not, give it another try.
>>>
>>> -tk
>>>
>>> On Fri, Jun 14, 2024 at 7:04 AM bgra...@umw.edu  wrote:
>>>
 I have successfully set up 5.0 on a test RPI5 connected to a second VP2 
 console. My main system, weewx 4.10.2, has been running on Ubuntu for over 
 10 years.

 I’m not at all familiar with the venv setup and how to use it with 
 respect to other programs installed on the RPI5. My question:

 * when I install a utility such as  Node-Red, should I be inside the 
  (weewx-venv) or installed from my standard home of bg@RPI5:~ ?
 I’m having problems enabling N-R with systemctl but can start it 
 manually. I feel that some links must be missing.

 Thanks for any pointers here.
 Cheers,
 Bob


 -- 
 You received this message because you are subscribed to the Google 
 Groups "weewx-user" group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to weewx-user+...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/weewx-user/843647ae-85bd-4d14-a686-42a8fed2984bn%40googlegroups.com
  
 
 .

>>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/344d7d71-5bb8-4fe2-8785-4bfbc1c9a57dn%40googlegroups.com.


Re: [weewx-user] Using venv for weewx 5.0

2024-06-14 Thread Tom Keffer
Python virtual environments are used to isolate Python runtimes. So, if you
want access to an extension or a Python module from within a runtime then,
yes, you need to activate the environment, then do the install into it.

It's worth creating a throwaway virtual environment then examining it. It's
quite simple. Inside, there is a "bin" directory, which contains a symbolic
link to the Python runtime that created it. There is also a shell script
called "activate" --- this is the script you run to "activate" the
environment. All it does is monkey with PATH to make sure the virtual
environments version of Python is found first.

Then there's a "lib" directory which will be nearly empty until you start
installing things into it.

That's pretty much it. Very simple.

-tk

On Fri, Jun 14, 2024 at 1:59 PM bgra...@umw.edu  wrote:

> Thanks, Tom, I’m learning my way into weewx 5.0. As I understand, weewx
> updates, python updates, and additions such as extensions need to be done
> while logged into venv. Everything else indtalled should be from the normal
> login.
> Weewx is a great system and I appreciate all the work you and many others
> have put in.
> Cheers,
> Bob
>
> On Friday, June 14, 2024 at 10:30:34 AM UTC-4 Tom Keffer wrote:
>
>> A virtual environment is just a way of isolating a Python-based runtime.
>> The environment locks down which instance of the Python interpreter will be
>> used, plus that interpreter gets its own copy of any installed Python
>> modules.
>>
>> Node Red uses the node interpreter, not the Python interpreter. You
>> install it using a node tool such as npm. Just install it as per their
>> instructions. Same with installing it as a systemd service.
>>
>> The two systems are really completely independent of each other.
>>
>> I'm not sure I've answered your question. If not, give it another try.
>>
>> -tk
>>
>> On Fri, Jun 14, 2024 at 7:04 AM bgra...@umw.edu  wrote:
>>
>>> I have successfully set up 5.0 on a test RPI5 connected to a second VP2
>>> console. My main system, weewx 4.10.2, has been running on Ubuntu for over
>>> 10 years.
>>>
>>> I’m not at all familiar with the venv setup and how to use it with
>>> respect to other programs installed on the RPI5. My question:
>>>
>>> * when I install a utility such as  Node-Red, should I be inside the
>>>  (weewx-venv) or installed from my standard home of bg@RPI5:~ ?
>>> I’m having problems enabling N-R with systemctl but can start it
>>> manually. I feel that some links must be missing.
>>>
>>> Thanks for any pointers here.
>>> Cheers,
>>> Bob
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "weewx-user" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to weewx-user+...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/weewx-user/843647ae-85bd-4d14-a686-42a8fed2984bn%40googlegroups.com
>>> 
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to weewx-user+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/5edb80c3-b06d-47c4-ad03-bf8d8b4c5a8bn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEBYrfO9%3DC%2BFYizd4H8i86fYvJro4zPmQ-EChjWmxQo6wQ%40mail.gmail.com.


Re: [weewx-user] Using venv for weewx 5.0

2024-06-14 Thread bgra...@umw.edu
Thanks, Tom, I’m learning my way into weewx 5.0. As I understand, weewx 
updates, python updates, and additions such as extensions need to be done 
while logged into venv. Everything else indtalled should be from the normal 
login.
Weewx is a great system and I appreciate all the work you and many others 
have put in.
Cheers,
Bob

On Friday, June 14, 2024 at 10:30:34 AM UTC-4 Tom Keffer wrote:

> A virtual environment is just a way of isolating a Python-based runtime. 
> The environment locks down which instance of the Python interpreter will be 
> used, plus that interpreter gets its own copy of any installed Python 
> modules. 
>
> Node Red uses the node interpreter, not the Python interpreter. You 
> install it using a node tool such as npm. Just install it as per their 
> instructions. Same with installing it as a systemd service.
>
> The two systems are really completely independent of each other. 
>
> I'm not sure I've answered your question. If not, give it another try.
>
> -tk
>
> On Fri, Jun 14, 2024 at 7:04 AM bgra...@umw.edu  wrote:
>
>> I have successfully set up 5.0 on a test RPI5 connected to a second VP2 
>> console. My main system, weewx 4.10.2, has been running on Ubuntu for over 
>> 10 years.
>>
>> I’m not at all familiar with the venv setup and how to use it with 
>> respect to other programs installed on the RPI5. My question:
>>
>> * when I install a utility such as  Node-Red, should I be inside the 
>>  (weewx-venv) or installed from my standard home of bg@RPI5:~ ?
>> I’m having problems enabling N-R with systemctl but can start it 
>> manually. I feel that some links must be missing.
>>
>> Thanks for any pointers here.
>> Cheers,
>> Bob
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "weewx-user" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to weewx-user+...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/843647ae-85bd-4d14-a686-42a8fed2984bn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/5edb80c3-b06d-47c4-ad03-bf8d8b4c5a8bn%40googlegroups.com.


Re: [weewx-user] Using venv for weewx 5.0

2024-06-14 Thread bgra...@umw.edu
Vince,
I've been using Node-Red to send MQTT data from several other sensors to 
weewx 4.10.2 on Ubuntu (VP2)--all working ok. I'm now trying to setup the 
same install on an RPI5 which is running weewx 5.0. Being unfamiliar with 
venv, I'm trying to understand what goes inside and outside of the virtual 
environment. Thanks.
Bob

On Friday, June 14, 2024 at 11:30:21 AM UTC-4 vince wrote:

> What are you actually trying to do with node-red ?  Not seeing what it has 
> to do with weewx.   Are you trying to use it to read other sensors or 
> something like that ?
>
> On Friday, June 14, 2024 at 7:30:34 AM UTC-7 Tom Keffer wrote:
>
>> A virtual environment is just a way of isolating a Python-based runtime. 
>> The environment locks down which instance of the Python interpreter will be 
>> used, plus that interpreter gets its own copy of any installed Python 
>> modules. 
>>
>> Node Red uses the node interpreter, not the Python interpreter. You 
>> install it using a node tool such as npm. Just install it as per their 
>> instructions. Same with installing it as a systemd service.
>>
>> The two systems are really completely independent of each other. 
>>
>> I'm not sure I've answered your question. If not, give it another try.
>>
>> -tk
>>
>> On Fri, Jun 14, 2024 at 7:04 AM bgra...@umw.edu  wrote:
>>
>>> I have successfully set up 5.0 on a test RPI5 connected to a second VP2 
>>> console. My main system, weewx 4.10.2, has been running on Ubuntu for over 
>>> 10 years.
>>>
>>> I’m not at all familiar with the venv setup and how to use it with 
>>> respect to other programs installed on the RPI5. My question:
>>>
>>> * when I install a utility such as  Node-Red, should I be inside the 
>>>  (weewx-venv) or installed from my standard home of bg@RPI5:~ ?
>>> I’m having problems enabling N-R with systemctl but can start it 
>>> manually. I feel that some links must be missing.
>>>
>>> Thanks for any pointers here.
>>> Cheers,
>>> Bob
>>>
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "weewx-user" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to weewx-user+...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/weewx-user/843647ae-85bd-4d14-a686-42a8fed2984bn%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/bfb08f07-139a-4bd8-ae7f-4d090697943en%40googlegroups.com.


Re: [weewx-user] Using venv for weewx 5.0

2024-06-14 Thread vince
What are you actually trying to do with node-red ?  Not seeing what it has 
to do with weewx.   Are you trying to use it to read other sensors or 
something like that ?

On Friday, June 14, 2024 at 7:30:34 AM UTC-7 Tom Keffer wrote:

> A virtual environment is just a way of isolating a Python-based runtime. 
> The environment locks down which instance of the Python interpreter will be 
> used, plus that interpreter gets its own copy of any installed Python 
> modules. 
>
> Node Red uses the node interpreter, not the Python interpreter. You 
> install it using a node tool such as npm. Just install it as per their 
> instructions. Same with installing it as a systemd service.
>
> The two systems are really completely independent of each other. 
>
> I'm not sure I've answered your question. If not, give it another try.
>
> -tk
>
> On Fri, Jun 14, 2024 at 7:04 AM bgra...@umw.edu  wrote:
>
>> I have successfully set up 5.0 on a test RPI5 connected to a second VP2 
>> console. My main system, weewx 4.10.2, has been running on Ubuntu for over 
>> 10 years.
>>
>> I’m not at all familiar with the venv setup and how to use it with 
>> respect to other programs installed on the RPI5. My question:
>>
>> * when I install a utility such as  Node-Red, should I be inside the 
>>  (weewx-venv) or installed from my standard home of bg@RPI5:~ ?
>> I’m having problems enabling N-R with systemctl but can start it 
>> manually. I feel that some links must be missing.
>>
>> Thanks for any pointers here.
>> Cheers,
>> Bob
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "weewx-user" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to weewx-user+...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/843647ae-85bd-4d14-a686-42a8fed2984bn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/ec6abdb3-7b28-4c53-a844-8dfaae189a81n%40googlegroups.com.


Re: [weewx-user] Using venv for weewx 5.0

2024-06-14 Thread Tom Keffer
A virtual environment is just a way of isolating a Python-based runtime.
The environment locks down which instance of the Python interpreter will be
used, plus that interpreter gets its own copy of any installed Python
modules.

Node Red uses the node interpreter, not the Python interpreter. You install
it using a node tool such as npm. Just install it as per their
instructions. Same with installing it as a systemd service.

The two systems are really completely independent of each other.

I'm not sure I've answered your question. If not, give it another try.

-tk

On Fri, Jun 14, 2024 at 7:04 AM bgra...@umw.edu  wrote:

> I have successfully set up 5.0 on a test RPI5 connected to a second VP2
> console. My main system, weewx 4.10.2, has been running on Ubuntu for over
> 10 years.
>
> I’m not at all familiar with the venv setup and how to use it with respect
> to other programs installed on the RPI5. My question:
>
> * when I install a utility such as  Node-Red, should I be inside the
>  (weewx-venv) or installed from my standard home of bg@RPI5:~ ?
> I’m having problems enabling N-R with systemctl but can start it manually.
> I feel that some links must be missing.
>
> Thanks for any pointers here.
> Cheers,
> Bob
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to weewx-user+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/843647ae-85bd-4d14-a686-42a8fed2984bn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEAnTg6mpoX4L_7Z%3DXxh%3DFyAt04uBAwjqN-BgYmqsm4D%3Dg%40mail.gmail.com.


[weewx-user] Using venv for weewx 5.0

2024-06-14 Thread bgra...@umw.edu
I have successfully set up 5.0 on a test RPI5 connected to a second VP2 
console. My main system, weewx 4.10.2, has been running on Ubuntu for over 
10 years.

I’m not at all familiar with the venv setup and how to use it with respect 
to other programs installed on the RPI5. My question:

* when I install a utility such as  Node-Red, should I be inside the 
 (weewx-venv) or installed from my standard home of bg@RPI5:~ ?
I’m having problems enabling N-R with systemctl but can start it manually. 
I feel that some links must be missing.

Thanks for any pointers here.
Cheers,
Bob


-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/843647ae-85bd-4d14-a686-42a8fed2984bn%40googlegroups.com.