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 <bgrat...@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 <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
>>> <https://groups.google.com/d/msgid/weewx-user/843647ae-85bd-4d14-a686-42a8fed2984bn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
> 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
> <https://groups.google.com/d/msgid/weewx-user/5edb80c3-b06d-47c4-ad03-bf8d8b4c5a8bn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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.

Reply via email to