Almanac Extras....

214 views
Skip to first unread message

Jason Gill

unread,
Mar 2, 2020, 2:54:56 AM3/2/20
to weewx-user
Hello,

I added pyephem to show extra almanac info on my main page. When I moved weewx between servers this stopped working although the setup seems the same.

Version Info:
pyephem version is 3.7.7.0
weewx version is v3.9.2

When I run "sudo wee_reports  /etc/weewx/weewx.conf" (seen in another post) the main page reports the following extended almanac info after wee_reports completes

Sun
Start civil twilight: 06:40:25 AM
Sunrise:         07:07:13 AM
Transit:         01:33:21 PM
Sunset:                 07:58:52 PM
End civil twilight: 08:25:36 PM
Equinox:         03/20/2020 04:49:32 PM
Solstice:         06/21/2020 09:43:46 AM
 
Moon
Rise:         01:41:29 PM
Transit: 06:55:13 PM
Set:         12:04:19 AM
Full moon: 03/10/2020 06:47:42 AM
New moon: 03/24/2020 10:28:11 PM
Phase:         First quarter (45% full)

When the next periods data arrives the almanac returns to this:

Sunrise: 07:07:36
Sunset:         19:59:08
Moon Phase: First quarter (50% full)

The same config file is used for both wee_reports and when I restart weewx. Any ideas - I must have missed something?

Regards,
Jason.





Thomas Keffer

unread,
Mar 2, 2020, 9:27:47 AM3/2/20
to weewx-user
Do you have several versions of Python on your machine? It's possible pyephem was installed using one version, but you're trying to run weewxd under another. 

Try invoking python explicitly when you run wee_reports and weewxd. This will guarantee that they are using the same version of Python:

sudo python /usr/share/weewx/weewxd /etc/weewx/weewx.conf
sudo python /usr/share/weewx/wee_reports /etc/weewx/weewx.conf

See if those give the same results.

-tk

--
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/c2f7ae08-3eb7-403d-a68e-0a2439f9e4e5%40googlegroups.com.

Jason Gill

unread,
Mar 4, 2020, 1:55:51 AM3/4/20
to weewx-user
Thanks for this.

You were correct - when I run with the explicit python I get the same result on both. 

I have python 2.7.17 and python 3.6.9 from what I can see. Do you mean multiple versions of 2.x.x (or 3.x.x) or would having 2 and 3 versions installed cause this problem?

Regards,
Jason.

On Tuesday, March 3, 2020 at 3:27:47 AM UTC+13, Thomas Keffer wrote:
Do you have several versions of Python on your machine? It's possible pyephem was installed using one version, but you're trying to run weewxd under another. 

Try invoking python explicitly when you run wee_reports and weewxd. This will guarantee that they are using the same version of Python:

sudo python /usr/share/weewx/weewxd /etc/weewx/weewx.conf
sudo python /usr/share/weewx/wee_reports /etc/weewx/weewx.conf

See if those give the same results.

-tk

To unsubscribe from this group and stop receiving emails from it, send an email to weewx...@googlegroups.com.

Thomas Keffer

unread,
Mar 4, 2020, 10:37:10 AM3/4/20
to weewx-user
Not sure I understand your question.

You are using WeeWX V3.9.2, which will run only under Python 2 so, unless you installed pyephem under Python 3, it should not be a factor. Try this to see where pyephem ended up:

This will tell us what version of Python is the default:
python -V

This will test whether pyephem was installed for the default version:
python -c "import ephem"

This will test whether pyephem was accidentally installed for Python 3:
python3 -c "import ephem"

-tk

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/44f9ef1e-8082-416d-bcbc-4fc3f749d179%40googlegroups.com.

Jason Gill

unread,
Mar 4, 2020, 6:16:43 PM3/4/20
to weewx-user
You answered my question indirectly, thanks.

python -V returns
Python 2.7.17

python -c "import ephem" returns nothing

python3 -c "import ephem" returns
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'ephem'

Regards,
Jason

On Thursday, March 5, 2020 at 4:37:10 AM UTC+13, Thomas Keffer wrote:
Not sure I understand your question.

You are using WeeWX V3.9.2, which will run only under Python 2 so, unless you installed pyephem under Python 3, it should not be a factor. Try this to see where pyephem ended up:

This will tell us what version of Python is the default:
python -V

This will test whether pyephem was installed for the default version:
python -c "import ephem"

This will test whether pyephem was accidentally installed for Python 3:
python3 -c "import ephem"

-tk

Vetti52

unread,
Jul 5, 2020, 2:41:06 PM7/5/20
to weewx-user
The other way roundin my case. After upgrading to 4.1.1, and moving from python2 to python3 celestial data fail. It contains this instead:

Install pyephem for detailed celestial timings.


And
python3 -c "import ephem"

returns nothing.

And when I run "sudo wee_reports  /etc/weewx/weewx.conf", celestial data are ok in the html file, as expected. But only until next html update.

So, where exactly do I have to trigger, that celestial will work with python3 as it should, and did with python2?

unhappy with my poor python skills.

Peter

Am Mittwoch, 4. März 2020 16:37:10 UTC+1 schrieb Thomas Keffer:
Not sure I understand your question.

You are using WeeWX V3.9.2, which will run only under Python 2 so, unless you installed pyephem under Python 3, it should not be a factor. Try this to see where pyephem ended up:

This will tell us what version of Python is the default:
python -V

This will test whether pyephem was installed for the default version:
python -c "import ephem"

This will test whether pyephem was accidentally installed for Python 3:
python3 -c "import ephem"

-tk

Tom Keffer

unread,
Jul 5, 2020, 3:23:15 PM7/5/20
to weewx-user
I don't quite understand the question. What do you mean by the "next html update"? The utility wee_reports runs only once.

Or, are you saying that wee_reports works as expected, but weewxd does not?

Also, you have not posted a log, so it's hard to draw any conclusions. 

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/1f0244d9-239f-4662-a077-43b6585e08d8o%40googlegroups.com.

Vetti52

unread,
Jul 6, 2020, 4:08:14 AM7/6/20
to weewx-user
Sorry, I was a bit too lazy:
wee_reports runs once and overwrites the html data of weewx.reportengine. After weewx updates its html reports again, the celestial data are gone.

Before, I tried these commands:

sudo pip3 install pyephem
sudo apt install python3-ephem
sudo python3 -c "import ephem"

I don't know, which ones were essential. But, silly enough:

systemctl restart weewx.service

resolved the problem. I should have known that.
Some solutions are much too simple!
thanks anyway!

-Peter
Reply all
Reply to author
Forward
0 new messages