[weewx-user] Re: rtgd-0.5.5 extension Wind Direction Average

2022-10-31 Thread gjr80
Thanks for spotting this. There is an issue is v0.5.5 that maps current 
wind direction to both the 'bearing' and 'avgbearing' fields used by the 
SteelSeries gauges. I should have a fix by tomorrow.

Gary

On Tuesday, 1 November 2022 at 05:34:05 UTC+10 marsha...@gmail.com wrote:

> Built a new station using an esp32 which mqtt’s data every second to a 
> Raspi. A python program converts this to a txt file which I then file parse 
> into weewx. All ok.
> I have successfully installed the steelseries gauges and the rtgd 
> extension. All works fine and it is fantastic to see the gauges updating in 
> real time.
>
> Just one small problem - the Wind Direction gauge shows latest and 
> average, but the average is always the same as the latest. Tried playing 
> with the rtgd.py program but even when I set data[avgdirection] to a 
> different value, nothing  changes.
>
> Any ideas?
>

-- 
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/4885c64e-4dca-4631-b2bb-0ee2c2d25473n%40googlegroups.com.


[weewx-user] Re: rtgd-0.5.5 extension Wind Direction Average

2022-10-31 Thread gary....@gmail.com
Use the MQTT driver which takes the data directly from your mosquitto 
server.
Avoids all the middleware.
I use Rich's excellent package.
https://github.com/bellrichm/WeeWX-MQTTSubscribe


On Monday, October 31, 2022 at 3:34:05 PM UTC-4 marsha...@gmail.com wrote:

> Built a new station using an esp32 which mqtt’s data every second to a 
> Raspi. A python program converts this to a txt file which I then file parse 
> into weewx. All ok.
> I have successfully installed the steelseries gauges and the rtgd 
> extension. All works fine and it is fantastic to see the gauges updating in 
> real time.
>
> Just one small problem - the Wind Direction gauge shows latest and 
> average, but the average is always the same as the latest. Tried playing 
> with the rtgd.py program but even when I set data[avgdirection] to a 
> different value, nothing  changes.
>
> Any ideas?
>

-- 
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/a297ee91-d20e-444e-9162-025ec99419e7n%40googlegroups.com.


Re: [weewx-user] No weewx-Weather34-main.zip

2022-10-31 Thread Brian Dowling
Will do, thx.

On Monday, October 31, 2022 at 4:04:35 PM UTC-5 tke...@gmail.com wrote:

> If the problem is in the weewx-Weather34 repo, it would be best to file an 
> issue there.
>
> On Mon, Oct 31, 2022 at 2:02 PM Brian Dowling  wrote:
>
>> Spotted what looked like a typo, no go. Cloned the repo, that didn't go 
>> real smooth (could be me, try again?).
>>
>> Please advise.
>>
>> -- 
>> 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/6c1c21d2-063f-404e-86e8-a0cdb739a0bcn%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/97cf8e59-a696-4237-aa2b-75b63ca02672n%40googlegroups.com.


Re: [weewx-user] No weewx-Weather34-main.zip

2022-10-31 Thread Tom Keffer
If the problem is in the weewx-Weather34 repo, it would be best to file an
issue there.

On Mon, Oct 31, 2022 at 2:02 PM Brian Dowling 
wrote:

> Spotted what looked like a typo, no go. Cloned the repo, that didn't go
> real smooth (could be me, try again?).
>
> Please advise.
>
> --
> 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/6c1c21d2-063f-404e-86e8-a0cdb739a0bcn%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/CAPq0zEBNpDU-VHzh%2Be4gh1uO%2BKseAJpzbNGAFGkweP-g0j_HuA%40mail.gmail.com.


[weewx-user] No weewx-Weather34-main.zip

2022-10-31 Thread Brian Dowling
Spotted what looked like a typo, no go. Cloned the repo, that didn't go 
real smooth (could be me, try again?).

Please advise.

-- 
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/6c1c21d2-063f-404e-86e8-a0cdb739a0bcn%40googlegroups.com.


[weewx-user] rtgd-0.5.5 extension Wind Direction Average

2022-10-31 Thread David Marshall
Built a new station using an esp32 which mqtt’s data every second to a 
Raspi. A python program converts this to a txt file which I then file parse 
into weewx. All ok.
I have successfully installed the steelseries gauges and the rtgd 
extension. All works fine and it is fantastic to see the gauges updating in 
real time.

Just one small problem - the Wind Direction gauge shows latest and average, 
but the average is always the same as the latest. Tried playing with the 
rtgd.py program but even when I set data[avgdirection] to a different 
value, nothing  changes.

Any ideas?

-- 
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/ca3039f7-b749-4e1b-94ef-e56912ea31b9n%40googlegroups.com.


Re: [weewx-user] Re: No module named 'Cheetah'

2022-10-31 Thread Tom Keffer
For some reason your copy of pip3 is using packages in the Python 2
library. Somehow it got broken. Perhaps it has the wrong shebang at the
top?

Try reinstalling it.

On Mon, Oct 31, 2022 at 12:03 PM Steve  wrote:

> I did try @rpi3:/home/weewx/bin# sudo pip3 install cheetah3
>
> Traceback (most recent call last):
>   File "/usr/local/bin/pip3", line 5, in 
> from pkg_resources import load_entry_point
>   File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
> 3019, in 
> @_call_aside
>   File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
> 3003, in _call_aside
> f(*args, **kwargs)
>   File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
> 3032, in _initialize_master_working_set
> working_set = WorkingSet._build_master()
>   File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
> 657, in _build_master
> return cls._build_from_requirements(__requires__)
>   File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
> 670, in _build_from_requirements
> dists = ws.resolve(reqs, Environment())
>   File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line
> 849, in resolve
> raise DistributionNotFound(req, requirers)
> pkg_resources.DistributionNotFound: The 'pip==8.1.0' distribution was not
> found and is required by the application
> @rpi3:/home/weewx/bin#
>
> On Tuesday, 1 November 2022 at 05:45:07 UTC+11 vince wrote:
>
>> On Monday, October 31, 2022 at 10:29:34 AM UTC-7 Steve wrote:
>>
>>> @rpi3:~# pip install Cheetah3
>>> DEPRECATION: Python 2.7 reached the end of its life on January 1st,
>>> 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip
>>> 21.0 will drop support for Python 2.7 in January 2021.
>>>
>>
>> Now would be a great time to switch to python3 if you can, given that
>> python2 is almost two years out of supportespecially since you are
>> running a setup.py installation and can easily do a backup of the whole
>> /home/weewx tree in one step...just in case.
>>
>> As Tom suggested, just use 'pip3' and 'python3' to be darn certain you
>> use the desired 'supported' python version for your os.
>>
>> Also, your os is 'really' out of date as well if you see python 3.5 in
>> /usr/lib.  A current raspi would have python 3.9 in /usr/lib, so you might
>> think about spending the five or so bucks and tossing a new SD card in with
>> current RaspiOS and getting everything current now.  Your time is worth
>> something to you too, as you might be battling version things for a long
>> time otherwise
>>
>>
>> --
> 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/cef127a8-b73a-4b2e-a81f-67e3c717dca0n%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/CAPq0zEDOeo6b0dZAe6Kc_ZpoDm6ynKztd3N_G6%2Bqr%3DSwoVFi1Q%40mail.gmail.com.


[weewx-user] Re: No module named 'Cheetah'

2022-10-31 Thread Steve
Thanks Vince.

I will update the OS when I get a chance, the Pi does a few other things 
besides Weewx. But like you mentioned, unless I get it current, I'll be 
battling stuff like this forever. I rolled back to v4.3.0 as I saved the 
image before playing with it.

On Tuesday, 1 November 2022 at 05:45:07 UTC+11 vince wrote:

> On Monday, October 31, 2022 at 10:29:34 AM UTC-7 Steve wrote:
>
>> @rpi3:~# pip install Cheetah3
>> DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. 
>> Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 
>> will drop support for Python 2.7 in January 2021. 
>>
>
> Now would be a great time to switch to python3 if you can, given that 
> python2 is almost two years out of supportespecially since you are 
> running a setup.py installation and can easily do a backup of the whole 
> /home/weewx tree in one step...just in case.
>
> As Tom suggested, just use 'pip3' and 'python3' to be darn certain you use 
> the desired 'supported' python version for your os.
>
> Also, your os is 'really' out of date as well if you see python 3.5 in 
> /usr/lib.  A current raspi would have python 3.9 in /usr/lib, so you might 
> think about spending the five or so bucks and tossing a new SD card in with 
> current RaspiOS and getting everything current now.  Your time is worth 
> something to you too, as you might be battling version things for a long 
> time otherwise
>
>
>

-- 
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/44bb855a-d963-4149-bafe-1f0527b2e3d5n%40googlegroups.com.


[weewx-user] Re: No module named 'Cheetah'

2022-10-31 Thread Steve
I did try @rpi3:/home/weewx/bin# sudo pip3 install cheetah3

Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 5, in 
from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 
3019, in 
@_call_aside
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 
3003, in _call_aside
f(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 
3032, in _initialize_master_working_set
working_set = WorkingSet._build_master()
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 
657, in _build_master
return cls._build_from_requirements(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 
670, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 
849, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==8.1.0' distribution was not 
found and is required by the application
@rpi3:/home/weewx/bin#

On Tuesday, 1 November 2022 at 05:45:07 UTC+11 vince wrote:

> On Monday, October 31, 2022 at 10:29:34 AM UTC-7 Steve wrote:
>
>> @rpi3:~# pip install Cheetah3
>> DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. 
>> Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 
>> will drop support for Python 2.7 in January 2021. 
>>
>
> Now would be a great time to switch to python3 if you can, given that 
> python2 is almost two years out of supportespecially since you are 
> running a setup.py installation and can easily do a backup of the whole 
> /home/weewx tree in one step...just in case.
>
> As Tom suggested, just use 'pip3' and 'python3' to be darn certain you use 
> the desired 'supported' python version for your os.
>
> Also, your os is 'really' out of date as well if you see python 3.5 in 
> /usr/lib.  A current raspi would have python 3.9 in /usr/lib, so you might 
> think about spending the five or so bucks and tossing a new SD card in with 
> current RaspiOS and getting everything current now.  Your time is worth 
> something to you too, as you might be battling version things for a long 
> time otherwise
>
>
>

-- 
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/cef127a8-b73a-4b2e-a81f-67e3c717dca0n%40googlegroups.com.


[weewx-user] Re: No module named 'Cheetah'

2022-10-31 Thread vince
On Monday, October 31, 2022 at 10:29:34 AM UTC-7 Steve wrote:

> @rpi3:~# pip install Cheetah3
> DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. 
> Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 
> will drop support for Python 2.7 in January 2021. 
>

Now would be a great time to switch to python3 if you can, given that 
python2 is almost two years out of supportespecially since you are 
running a setup.py installation and can easily do a backup of the whole 
/home/weewx tree in one step...just in case.

As Tom suggested, just use 'pip3' and 'python3' to be darn certain you use 
the desired 'supported' python version for your os.

Also, your os is 'really' out of date as well if you see python 3.5 in 
/usr/lib.  A current raspi would have python 3.9 in /usr/lib, so you might 
think about spending the five or so bucks and tossing a new SD card in with 
current RaspiOS and getting everything current now.  Your time is worth 
something to you too, as you might be battling version things for a long 
time otherwise


-- 
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/37f92b32-fd61-43e4-a850-e53f26a2120an%40googlegroups.com.


Re: [weewx-user] No module named 'Cheetah'

2022-10-31 Thread Tom Keffer
I can think of two reasons why this might be happening.

1. You are using a Python 2 version of pip, which will install packages in
the Python 2 directory hierarchy. If you then run weewxd using Python 3, it
won't find it.

I almost never invoke Python as "python", nor pip as "pip". Instead, use
the "3" suffix: python3 or pip3. That way you can be sure of which version
you're getting.

2. Did you try to install Cheetah from the weewx distribution subdirectory?
If so, pip will see the setup.cfg in there and install it in a funny place
where Python can't find it. Take a look in /home/weewx/bin and see if
Cheetah ended up there.

If that's the case, cd to something else and try again.

cd /home/weewx
pip install Cheetah3



On Mon, Oct 31, 2022 at 10:29 AM Steve  wrote:

> Probably the wrong forum to ask, but I'm at my wits end. I've always used
> the setup.py method to update WeeWx.
>
> I updated WeeWX to 4.9.1 from maybe 4.3.0? Followed the setup.py
> instructions (in /usr there are python3 and python3.5 directories).
>
> I get an error in the log file "No module named 'Cheetah'"
>
> I get this in my terminal
>
> @rpi3:~# pip install Cheetah3
> DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020.
> Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0
> will drop support for Python 2.7 in January 2021. More details about Python
> 2 support in pip can be found at
> https://pip.pypa.io/en/latest/development/release-process/#python-2-support
> pip 21.0 will remove support for this functionality.
> Looking in indexes: https://pypi.org/simple,
> https://www.piwheels.org/simple
> Requirement already satisfied: Cheetah3 in
> /usr/local/lib/python2.7/dist-packages (3.2.6.post1)
>
> --
> 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/9d0031f0-08eb-465e-a16d-a3c6cfba5721n%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/CAPq0zECK5_8wqp1V7mQ3pBsZDr%3DdZjvqwkSS61Rpqz5X%3DgLuyw%40mail.gmail.com.


Re: [weewx-user] Installing and use weewx with a virtual environment

2022-10-31 Thread Tom Keffer
Posted as a wiki article:
https://github.com/weewx/weewx/wiki/Run-WeeWX-in-a-virtual-environment

On Mon, Oct 31, 2022 at 10:25 AM Tom Keffer  wrote:

> Unfortunately, as you discovered, this is a little tricky. If you run
> setup.py from the virtual environment, things end up in funny places.
>
> Instead, use the system's python to set things up using setup.py, then
> switch to the virtual environment to install dependencies, then run weewxd.
> But, first you'll need configobj, because setup.py requires it. However, DO
> NOT INSTALL configobj from the weewx distribution subdirectory, because pip
> will see the setup.cfg and put configobj in a funny spot.
>
> Here's  the way I do it:
>
> # First install configobj. Can be done anywhere, but NOT in the weewx
> distribution subdirectory
> cd /home/weewx
> python3 -m pip install --user configobj
> # Unpack the tarball, then cd into the resultant subdirectory
> tar xvf weewx-4.9.1.tar.gz
> cd weewx-4.9.1
> # Set up /home/weewx using the system's version of python
> python3 setup.py install
> # Now set up the venv in /home/weewx
> cd /home/weewx
> python3 -m venv weewx_venv
> # Activate it
> source ./weewx_venv/bin/activate
> # Install dependencies in the  virtual environment
> python3 -m pip install configobj Cheetah3 Pillow pyserial pyusb pyephem
> # Now you can run weewxd in the virtual environment
> python3 ./bin/weewxd
>
> For running as a systemd daemon, set up your systemd file so that it uses
> the version of Python in the venv. That is, ExecStart will look something
> like this:
>
> ExecStart=/home/weewx/weewx_venv/bin/python3 /home/weewx/bin/weewxd
> /home/weewx/weewx.conf
>
> A major goal of WeeWX Version 5 is to make this all easier. In particular,
> use pipenv, or similar tool, to install things from pypi.org into a
> virtual environment. Unfortunately, we may end up with a bit of a hybrid
> mix because the Python install tools are not really designed to handle data
> such as the skins and configuration file.
>
> Let me know how things go.
>
> -tk
>
>
> On Mon, Oct 31, 2022 at 9:12 AM gearoid  wrote:
>
>> I'd like to be able to install weewx and run it using a virtual
>> environment instead of using the system's interpreter.
>>
>> When I run "sudo  setup.py install" I get an error
>> about not being able to use both prefix and exec_prefix.
>> I commented out exec_prefix= in setup.py.
>> The install runs but a bunch of files are placed in the virtual
>> environment's directory and not in /home/weewx.
>>
>> I moved those files into /home/weewx myself and it seem to be working.
>>
>> I'd like to be able to do that without those hacks.  If someone can give
>> some pointers and it's a reasonable thing to be able to do I'd be happy to
>> make the PR.
>>
>> I'm using Ubuntu, pyenv to install python 3.10.8.
>> Using python venv to create the 3.10.8 virtual environment and then pip
>> to install the required modules (so no apt installed packages).
>>
>> Gearoid.
>>
>> --
>> 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/8fa1b5ce-7c78-449f-bf56-b9a2b53de99dn%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/CAPq0zEADvCEUvM42ngD6%2Bog0wTP1_zDu-NFfzhjj_-stizZpTA%40mail.gmail.com.


[weewx-user] No module named 'Cheetah'

2022-10-31 Thread Steve
Probably the wrong forum to ask, but I'm at my wits end. I've always used 
the setup.py method to update WeeWx.

I updated WeeWX to 4.9.1 from maybe 4.3.0? Followed the setup.py 
instructions (in /usr there are python3 and python3.5 directories).

I get an error in the log file "No module named 'Cheetah'"

I get this in my terminal 

@rpi3:~# pip install Cheetah3
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. 
Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 
will drop support for Python 2.7 in January 2021. More details about Python 
2 support in pip can be found at 
https://pip.pypa.io/en/latest/development/release-process/#python-2-support 
pip 21.0 will remove support for this functionality.
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: Cheetah3 in 
/usr/local/lib/python2.7/dist-packages (3.2.6.post1)

-- 
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/9d0031f0-08eb-465e-a16d-a3c6cfba5721n%40googlegroups.com.


Re: [weewx-user] Installing and use weewx with a virtual environment

2022-10-31 Thread Tom Keffer
Unfortunately, as you discovered, this is a little tricky. If you run
setup.py from the virtual environment, things end up in funny places.

Instead, use the system's python to set things up using setup.py, then
switch to the virtual environment to install dependencies, then run weewxd.
But, first you'll need configobj, because setup.py requires it. However, DO
NOT INSTALL configobj from the weewx distribution subdirectory, because pip
will see the setup.cfg and put configobj in a funny spot.

Here's  the way I do it:

# First install configobj. Can be done anywhere, but NOT in the weewx
distribution subdirectory
cd /home/weewx
python3 -m pip install --user configobj
# Unpack the tarball, then cd into the resultant subdirectory
tar xvf weewx-4.9.1.tar.gz
cd weewx-4.9.1
# Set up /home/weewx using the system's version of python
python3 setup.py install
# Now set up the venv in /home/weewx
cd /home/weewx
python3 -m venv weewx_venv
# Activate it
source ./weewx_venv/bin/activate
# Install dependencies in the  virtual environment
python3 -m pip install configobj Cheetah3 Pillow pyserial pyusb pyephem
# Now you can run weewxd in the virtual environment
python3 ./bin/weewxd

For running as a systemd daemon, set up your systemd file so that it uses
the version of Python in the venv. That is, ExecStart will look something
like this:

ExecStart=/home/weewx/weewx_venv/bin/python3 /home/weewx/bin/weewxd
/home/weewx/weewx.conf

A major goal of WeeWX Version 5 is to make this all easier. In particular,
use pipenv, or similar tool, to install things from pypi.org into a virtual
environment. Unfortunately, we may end up with a bit of a hybrid mix
because the Python install tools are not really designed to handle data
such as the skins and configuration file.

Let me know how things go.

-tk


On Mon, Oct 31, 2022 at 9:12 AM gearoid  wrote:

> I'd like to be able to install weewx and run it using a virtual
> environment instead of using the system's interpreter.
>
> When I run "sudo  setup.py install" I get an error
> about not being able to use both prefix and exec_prefix.
> I commented out exec_prefix= in setup.py.
> The install runs but a bunch of files are placed in the virtual
> environment's directory and not in /home/weewx.
>
> I moved those files into /home/weewx myself and it seem to be working.
>
> I'd like to be able to do that without those hacks.  If someone can give
> some pointers and it's a reasonable thing to be able to do I'd be happy to
> make the PR.
>
> I'm using Ubuntu, pyenv to install python 3.10.8.
> Using python venv to create the 3.10.8 virtual environment and then pip to
> install the required modules (so no apt installed packages).
>
> Gearoid.
>
> --
> 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/8fa1b5ce-7c78-449f-bf56-b9a2b53de99dn%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/CAPq0zEB9HCto4N%2B0kDbkAN%2B6gmjYiWnbyVZERwZ_oGP%2BDfiG7Q%40mail.gmail.com.


[weewx-user] Installing and use weewx with a virtual environment

2022-10-31 Thread gearoid
I'd like to be able to install weewx and run it using a virtual environment 
instead of using the system's interpreter.

When I run "sudo  setup.py install" I get an error 
about not being able to use both prefix and exec_prefix.
I commented out exec_prefix= in setup.py.
The install runs but a bunch of files are placed in the virtual 
environment's directory and not in /home/weewx.

I moved those files into /home/weewx myself and it seem to be working.

I'd like to be able to do that without those hacks.  If someone can give 
some pointers and it's a reasonable thing to be able to do I'd be happy to 
make the PR.

I'm using Ubuntu, pyenv to install python 3.10.8.
Using python venv to create the 3.10.8 virtual environment and then pip to 
install the required modules (so no apt installed packages).

Gearoid.

-- 
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/8fa1b5ce-7c78-449f-bf56-b9a2b53de99dn%40googlegroups.com.