Re: [weewx-user] WeeWX v5 pip Install into venv

2023-08-26 Thread gary....@gmail.com
Thanks guys, installed into a new ubuntu 23.04 instance using venv and as a 
normal user.
I like the new install from a url for extensions.

On Friday, August 25, 2023 at 7:23:16 PM UTC-4 Greg from Oz wrote:

> I am running V5 and I put all my venv files into /opt so I have to 
> remember to run the full path:
> EG sudo /opt/weewx/weewx-venv/bin/wee_reports 
> --config=/opt/weewx/weewx-data/weewx.conf
>
> To use the venv I run :source /opt/weewx/weewx-venv/bin/activate
> also if you want to exit the venv type the command: *deactivate*
>
> Like Tom said the systemctl uses the full path:
> ExecStart=/opt/weewx/weewx-venv/bin/python3 
> /opt/weewx/weewx-venv/lib/python3.11/site-packages/weewxd.py 
> /opt/weewx/weewx-data/weewx.conf
>
> I am running weewx as root user but my config files have my user 
> permissions and ownership.
>
> On Saturday, 26 August 2023 at 09:12:48 UTC+10 Tom Keffer wrote:
>
>> Running the venv's binaries (versus activation) is completely acceptable. 
>> Indeed, that's what the systemctl unit file does.
>>
>> On Fri, Aug 25, 2023 at 3:27 AM Greg Troxel  wrote:
>>
>>> Graham Eddy  writes:
>>>
>>> > use ‘python3 -m venv ~/venv’ to create the environment in ~/venv.
>>> > then in your shell run ’source ~/venv/bin/activate’ to set up the 
>>> shell environment (initialised python bindary, PYTHONPATH etc). i put this 
>>> in my ~/.bashrc
>>> >
>>> > a key trick is that running the initialised python binary 
>>> (~/venv/bin/python3) on its own sucks in the environment - really, really 
>>> handy in systemctl unit files
>>> > ⊣GE⊢
>>>
>>> I have never activated a venv and always been puzzled by this being the
>>> standard approach.  Simply running the venv' python binary, either
>>> explicitly on the command line, or via a #!, has been entirely fine.  I
>>> have home assistant working this way, which is super comlicated compared
>>> to weewx.
>>>
>>> I also run, when in the venv dir
>>>
>>>   bin/pip install foo
>>>
>>> which runs the venv's pip which uses the venv's python.
>>>
>>> I'm glad to hear that there is no special 'have to activate' rule about
>>> weewx.
>>>
>>>
>>>
>>>
>>> -- 
>>> 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/rmi1qfre7t2.fsf%40s1.lexort.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/db1e2eb8-c149-42c5-8fe4-4ecfd9791551n%40googlegroups.com.


Re: [weewx-user] WeeWX v5 pip Install into venv

2023-08-25 Thread Greg from Oz
I am running V5 and I put all my venv files into /opt so I have to remember 
to run the full path:
EG sudo /opt/weewx/weewx-venv/bin/wee_reports 
--config=/opt/weewx/weewx-data/weewx.conf

To use the venv I run :source /opt/weewx/weewx-venv/bin/activate
also if you want to exit the venv type the command: *deactivate*

Like Tom said the systemctl uses the full path:
ExecStart=/opt/weewx/weewx-venv/bin/python3 
/opt/weewx/weewx-venv/lib/python3.11/site-packages/weewxd.py 
/opt/weewx/weewx-data/weewx.conf

I am running weewx as root user but my config files have my user 
permissions and ownership.

On Saturday, 26 August 2023 at 09:12:48 UTC+10 Tom Keffer wrote:

> Running the venv's binaries (versus activation) is completely acceptable. 
> Indeed, that's what the systemctl unit file does.
>
> On Fri, Aug 25, 2023 at 3:27 AM Greg Troxel  wrote:
>
>> Graham Eddy  writes:
>>
>> > use ‘python3 -m venv ~/venv’ to create the environment in ~/venv.
>> > then in your shell run ’source ~/venv/bin/activate’ to set up the shell 
>> environment (initialised python bindary, PYTHONPATH etc). i put this in my 
>> ~/.bashrc
>> >
>> > a key trick is that running the initialised python binary 
>> (~/venv/bin/python3) on its own sucks in the environment - really, really 
>> handy in systemctl unit files
>> > ⊣GE⊢
>>
>> I have never activated a venv and always been puzzled by this being the
>> standard approach.  Simply running the venv' python binary, either
>> explicitly on the command line, or via a #!, has been entirely fine.  I
>> have home assistant working this way, which is super comlicated compared
>> to weewx.
>>
>> I also run, when in the venv dir
>>
>>   bin/pip install foo
>>
>> which runs the venv's pip which uses the venv's python.
>>
>> I'm glad to hear that there is no special 'have to activate' rule about
>> weewx.
>>
>>
>>
>>
>> -- 
>> 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/rmi1qfre7t2.fsf%40s1.lexort.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/f60c2332-6151-48d3-8573-3d282460355bn%40googlegroups.com.


Re: [weewx-user] WeeWX v5 pip Install into venv

2023-08-25 Thread Tom Keffer
Running the venv's binaries (versus activation) is completely acceptable.
Indeed, that's what the systemctl unit file does.

On Fri, Aug 25, 2023 at 3:27 AM Greg Troxel  wrote:

> Graham Eddy  writes:
>
> > use ‘python3 -m venv ~/venv’ to create the environment in ~/venv.
> > then in your shell run ’source ~/venv/bin/activate’ to set up the shell
> environment (initialised python bindary, PYTHONPATH etc). i put this in my
> ~/.bashrc
> >
> > a key trick is that running the initialised python binary
> (~/venv/bin/python3) on its own sucks in the environment - really, really
> handy in systemctl unit files
> > ⊣GE⊢
>
> I have never activated a venv and always been puzzled by this being the
> standard approach.  Simply running the venv' python binary, either
> explicitly on the command line, or via a #!, has been entirely fine.  I
> have home assistant working this way, which is super comlicated compared
> to weewx.
>
> I also run, when in the venv dir
>
>   bin/pip install foo
>
> which runs the venv's pip which uses the venv's python.
>
> I'm glad to hear that there is no special 'have to activate' rule about
> weewx.
>
>
>
>
> --
> 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/rmi1qfre7t2.fsf%40s1.lexort.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/CAPq0zEDPagn7x_3sTzXexEdWyGXozGNGJ2-xcV6G88FE9fRh7w%40mail.gmail.com.


Re: [weewx-user] WeeWX v5 pip Install into venv

2023-08-25 Thread Greg Troxel
Graham Eddy  writes:

> use ‘python3 -m venv ~/venv’ to create the environment in ~/venv.
> then in your shell run ’source ~/venv/bin/activate’ to set up the shell 
> environment (initialised python bindary, PYTHONPATH etc). i put this in my 
> ~/.bashrc
>
> a key trick is that running the initialised python binary 
> (~/venv/bin/python3) on its own sucks in the environment - really, really 
> handy in systemctl unit files
> ⊣GE⊢

I have never activated a venv and always been puzzled by this being the
standard approach.  Simply running the venv' python binary, either
explicitly on the command line, or via a #!, has been entirely fine.  I
have home assistant working this way, which is super comlicated compared
to weewx.

I also run, when in the venv dir

  bin/pip install foo

which runs the venv's pip which uses the venv's python.

I'm glad to hear that there is no special 'have to activate' rule about
weewx.


 

-- 
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/rmi1qfre7t2.fsf%40s1.lexort.com.


Re: [weewx-user] WeeWX v5 pip Install into venv

2023-08-24 Thread Graham Eddy
use ‘python3 -m venv ~/venv’ to create the environment in ~/venv.
then in your shell run ’source ~/venv/bin/activate’ to set up the shell 
environment (initialised python bindary, PYTHONPATH etc). i put this in my 
~/.bashrc

a key trick is that running the initialised python binary (~/venv/bin/python3) 
on its own sucks in the environment - really, really handy in systemctl unit 
files
⊣GE⊢

> On 25 Aug 2023, at 10:41 am, vince  wrote:
> 
> For the venv you do a 'source weewx-venv/bin/activate' then do a pip install 
> to add modules within the venv.   All you have to remember is to activate the 
> venv before running weectl, as well as read the docs for the new syntax for 
> doing things.  It's pretty easy to pick up.
> 
> systemctl works fine.  Just go with it :-)

-- 
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/AB60763A-9EF8-4C4A-B870-2300896D0768%40geddy.au.


[weewx-user] WeeWX v5 pip Install into venv

2023-08-24 Thread gary....@gmail.com
I installed v5 from an alpha long ago. I've upgraded along the way with 
little issue.

This was on my test machine, a drive went sideways and a complete rebuild 
was in order. One good thing, a shiny new SSD is in place.

Now, it seems that a venv is preferred.

So, how to accomplish that? I have zero experience with a venv. I have had 
to use the package manager to get a couple of python packages though and 
don't know how that will work with a venv.

How will this work for systemctl (service)?
I install and manage WeeWX as root on v4.x.x but I'm going to attempt to 
run as a user with venv. Where will the WeeWX directories reside?

If there is an up to date doc/wiki dealing with this, kindly point me 
towards it.

-- 
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/3b85870b-4709-435d-8512-e94c1a4cdc1bn%40googlegroups.com.