Thanks Tom.

As you suspected...

$ python -c "import sqlite3; sqlite3.connect(':memory:').execute('SELECT 
RADIANS(1.0)')"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
sqlite3.OperationalError: no such function: RADIANS
$ python3 -c "import sqlite3; sqlite3.connect(':memory:').execute('SELECT 
RADIANS(1.0)')"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
sqlite3.OperationalError: no such function: RADIANS

I replaced sqlite.py with your modified one and all is well.  I also 
deleted the sqlite.pyc file at the same location and cleared the Firefox 
cache.

A beautiful day in Phoenix today...  https://cjnaz.duckdns.org/weewx/
Thank you,
cjn

On Thursday, November 24, 2022 at 12:42:07 PM UTC-7 [email protected] wrote:

> I've had the same problem on the Mac. Apparently, there are modern sqlite3 
> libraries out there that were not compiled with 
> the DSQLITE_ENABLE_MATH_FUNCTIONS option.
>
> To test, run this:
>
> *python -c "import sqlite3; sqlite3.connect(':memory:').execute('SELECT 
> RADIANS(1.0)')"*
>
>
> If you get the error
>
> sqlite3.OperationalError: no such function: RADIANS
>
>
> then your library was not compiled with the flag.
>
> I've changed to code to explicitly test for the math functions rather than 
> rely on a version number. Replace your copy of weedb/sqlite.py (usually 
> found in /usr/share/weewx/weedb/sqlite.py) with this one. 
> <https://raw.githubusercontent.com/weewx/weewx/cbd8b570cfa0488721db5739c73a26c4fd2fe78b/bin/weedb/sqlite.py>
>
>
>
>
>
>
> On Thu, Nov 24, 2022 at 11:25 AM Chris Nelson <[email protected]> wrote:
>
>> Hum...  I still have the problem.  I've read the 
>> <https://groups.google.com/g/weewx-user/c/VMUPd4l5H_w/m/o0cl7EJEBQAJ>Version 
>> 4.9.0 available 
>> <https://groups.google.com/g/weewx-user/c/VMUPd4l5H_w/m/o0cl7EJEBQAJ> 
>> and  weedb.OperationalError: no such function: RADIANS 
>> <https://groups.google.com/g/weewx-user/c/WQAUCUAKe18/m/fjsbwJSWBQAJ> 
>> threads, and the issue was to be fixed in 4.9.1.  I had updated from 4.8.0 
>> to 4.9.1 on Nov 11 and have the problem since then.  Hints please.  Thank 
>> you. 
>>
>> The report generator seems to crash when generating the Month page.  Day 
>> and Week pages update as expected.  It appears that weewx is still trying 
>> to use the RADIANS function in sqlite3. 
>>
>> I'm on Centos 7 with weewx running the official (ancient) Python3 
>> install, and running via systemd. 
>>
>> $ yum info weewx
>> ...
>> Installed Packages
>> Name : weewx
>> Arch : noarch
>> Version : 4.9.1
>> Release : 1.el7
>> Size : 5.5 M
>> Repo : installed
>> From repo : weewx
>> Summary : weather software
>> URL : http://www.weewx.com
>>
>> The webpage displays 
>> About this station ♦ 
>>
>> Hardware 
>> AcuRite 01035 
>> Latitude 
>> 33° 16.92' N 
>> Longitude 
>> 111° 44.39' W 
>> Altitude 
>> 1285 feet 
>> Server uptime 
>> 0 days, 0 hours, 28 minutes 
>> WeeWX uptime 
>> 0 days, 0 hours, 28 minutes 
>> WeeWX version 
>> 4.9.1 
>> Skin 
>> Seasons 4.9.1
>>
>> The systemd unit file has...
>> [Service]
>> ExecStart=/usr/bin/python3 /usr/share/weewx/weewxd --daemon 
>> --pidfile=/var/run/weewx.pid /etc/weewx/weewx.conf
>>
>> Python3 (ancient) version...
>> $ python3 -V
>> Python 3.6.8
>>
>> The sqlite3 version is (ancient) per the base os...
>> $ python3 -c "import sqlite3; print(sqlite3.sqlite_version)"
>> 3.7.17
>>
>> Attached is the log...
>>
>>
>>
>> On Friday, October 28, 2022 at 2:34:56 AM UTC-7 [email protected] wrote:
>>
>>> Tnx. I didn't know that this is connected :-)
>>>
>> -- 
>>
> 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 [email protected].
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/fa146277-2a97-46c7-b8db-ee380e74998an%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/weewx-user/fa146277-2a97-46c7-b8db-ee380e74998an%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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/cf776710-1882-41e8-8806-eea713dd39c8n%40googlegroups.com.

Reply via email to