$ sudo apt-get install git$ mkdir /var/tmp/weewx4_src
$ cd /var/tmp/weewx4_src
$ sudo PYTHONPATH=/var/tmp/weewx4_src/weewx/bin /var/tmp/weewx4_src/weewx/bin/wee_import --help
$ sudo PYTHONPATH=/var/tmp/weewx4_src/weewx/bin /var/tmp/weewx4_src/weewx/bin/wee_import --version
$ sudo PYTHONPATH=/var/tmp/weewx4_src/weewx/bin /var/tmp/weewx4_src/weewx/bin/wee_import --config=/home/weewx/weewx.conf --import-config=/var/tmp/wu.conf --date=2019-11-30$ rm -R /var/tmp/weewx4_srcgit clone -b development https://github.com/weewx/weewx
Cloning into 'weewx'...
remote: Enumerating objects: 45, done.
remote: Counting objects: 100% (45/45), done.
remote: Compressing objects: 100% (37/37), done.
remote: Total 35534 (delta 17), reused 24 (delta 8), pack-reused 35489
Receiving objects: 100% (35534/35534), 15.58 MiB | 306.00 KiB/s, done.
Resolving deltas: 100% (27219/27219), done.
$ sudo yum install python3-configobj
There may be other flow on dependency issues.
Alternatively, you could temporarily remove your python 3 symlink and run wee_import, this would run wee_import under python2 and use your (presumably) already installed pre-requisites.
Gary
Gary
Pleasantly surprised this forum is so active. Been lurking for awhile but never turned on the email notifies. Wow?!
Thanks for all the tips and advice. Going to give it another go tomorrow.
Just goes to show there will likely be a number users experiencing WeeWX/python version issues when 4.0 is released.
Gary
/usr/bin/python -> python2/usr/bin/python2 -> python2.7/usr/bin/python2.7
mkdir /var/tmp/weewx4_srccd /var/tmp/weewx4_src
git clone -b development https://github.com/weewx/weewx
sudo PYTHONPATH=/var/tmp/weewx4_src/weewx/bin /var/tmp/weewx4_src/weewx/bin/wee_import --help
Traceback (most recent call last):
File "/var/tmp/weewx4_src/weewx/bin/wee_import", line 726, in <module>
import weeimport.weeimport
File "/var/tmp/weewx4_src/weewx/bin/weeimport/weeimport.py", line 30, in <module>
import weecfg.database
File "/var/tmp/weewx4_src/weewx/bin/weecfg/database.py", line 22, in <module>
import weewx.manager
File "/var/tmp/weewx4_src/weewx/bin/weewx/manager.py", line 21, in <module>
import weewx.accum
File "/var/tmp/weewx4_src/weewx/bin/weewx/accum.py", line 95, in <module>
defaults_dict = configobj.ConfigObj(StringIO(DEFAULTS_INI), encoding='utf-8')
File "/usr/lib/python2.7/site-packages/configobj.py", line 1242, in __init__
self._load(infile, configspec)
File "/usr/lib/python2.7/site-packages/configobj.py", line 1302, in _load
infile = self._handle_bom(infile)
File "/usr/lib/python2.7/site-packages/configobj.py", line 1442, in _handle_bom
if not line.startswith(BOM):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 0: ordinal not in range(128)
--
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/b9bafcb0-5496-4f72-bb04-7db24b157670%40googlegroups.com.
No package python3-configobj available.
Error: Nothing to do
yum provides configobj.py
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* atomic: www7.atomicorp.com
* base: mirror.sfo12.us.leaseweb.net
* epel: mirror.sfo12.us.leaseweb.net
* extras: mirror.sfo12.us.leaseweb.net
* updates: mirror.sfo12.us.leaseweb.net
python-configobj-4.7.2-7.el7.noarch : Config file reading, writing, and
: validation
Repo : base
Matched from:
Filename : /usr/lib/python2.7/site-packages/configobj.py
python-configobj-4.7.2-7.el7.noarch : Config file reading, writing, and
: validation
Repo : @anaconda
Matched from:
Filename : /usr/lib/python2.7/site-packages/configobj.py
--
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/486ae325-251b-42aa-9163-ac48d6e1c81b%40googlegroups.com.
---
vim +95 /var/tmp/weewx4_src/weewx/bin/weewx/accum.py
---
defaults_dict = configobj.ConfigObj(StringIO(DEFAULTS_INI)) # Modification
accum_dict = None
---
sudo PYTHONPATH=/var/tmp/weewx4_src/weewx/bin /var/tmp/weewx4_src/weewx/bin/wee_import --help
Traceback (most recent call last):
File "/var/tmp/weewx4_src/weewx/bin/wee_import", line 726, in <module>
import weeimport.weeimport
File "/var/tmp/weewx4_src/weewx/bin/weeimport/weeimport.py", line 30, in <module>
import weecfg.database
File "/var/tmp/weewx4_src/weewx/bin/weecfg/database.py", line 22, in <module>
import weewx.manager
File "/var/tmp/weewx4_src/weewx/bin/weewx/manager.py", line 21, in <module>
import weewx.accum
File "/var/tmp/weewx4_src/weewx/bin/weewx/accum.py", line 96, in <module>
defaults_dict = configobj.ConfigObj(StringIO(DEFAULTS_INI))
File "/usr/lib/python2.7/site-packages/configobj.py", line 1242, in __init__
self._load(infile, configspec)
File "/usr/lib/python2.7/site-packages/configobj.py", line 1302, in _load
infile = self._handle_bom(infile)
File "/usr/lib/python2.7/site-packages/configobj.py", line 1457, in _handle_bom
if not line.startswith(BOM):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 0: ordinal not in range(128)
io.StringIO wants to work with unicode. You might think you can fix it by putting auin front of the string you want to print like this
To unsubscribe from this group and stop receiving emails from it, send an email to weewx...@googlegroups.com.
What version should I be running? yum indicates that I am running the recent version. Have to go to work, but I will keep looking in my spare time.
--
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/23d6cea0-8cb2-40f2-9464-93707911fc2e%40googlegroups.com.
$ cd /var/tmp/weewx4_src/weewx
$ git pullOK, the problem is your older version of configobj. However, I found a workaround that will work for all versions.Look for v4.0.0b7 in the usual place.Please try this version of WeeWX. Do not upgrade your configobj. We want to make sure it will work with all versions!-tk
On Sun, Jan 5, 2020 at 2:44 PM vince <vince...@gmail.com> wrote:
On Sunday, January 5, 2020 at 1:22:19 PM UTC-8, KnC Mc wrote:--What version should I be running? yum indicates that I am running the recent version. Have to go to work, but I will keep looking in my spare time.I got the beta running in Simulator mode under python3 on centos7 after a bit of fiddling. Let me let it run for a couple hours and I'll check it at halftime of the football game and post details if it stays up ok.
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...@googlegroups.com.
cd /var/tmp/weewx4_src/weewx
git pull
sudo PYTHONPATH=/var/tmp/weewx4_src/weewx/bin /var/tmp/weewx4_src/weewx/bin/wee_import --help
Traceback (most recent call last):
File "/var/tmp/weewx4_src/weewx/bin/wee_import", line 900, in <module>
main()
File "/var/tmp/weewx4_src/weewx/bin/wee_import", line 760, in main
weeutil.logger.setup('wee_import', {})
File "/var/tmp/weewx4_src/weewx/bin/weeutil/logger.py", line 83, in setup
log_config = configobj.ConfigObj(StringIO(LOGGING_STR), interpolation=False)
File "/usr/lib/python2.7/site-packages/configobj.py", line 1242, in __init__
self._load(infile, configspec)
File "/usr/lib/python2.7/site-packages/configobj.py", line 1302, in _load
infile = self._handle_bom(infile)
File "/usr/lib/python2.7/site-packages/configobj.py", line 1457, in _handle_bom
if not line.startswith(BOM):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 0: ordinal not in range(128)
I checked out pip on one of my Pis and see it is a package manager for python. Very cool! I won't do anything on my CentOS machine with this experiment until I hear back. I have a couple other projects at the moment, so I will work thru the weewx issue on my CentOS machine with your guidance. I hope to have another instance up on a Pi next weekend, so I can explore the code, and tweak things on a machine that isn't something I worry about breaking. ;)
--
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/00c4437b-8486-4ab4-90de-5c343bb6e993%40googlegroups.com.
Look at that... Great Job!
sudo PYTHONPATH=/var/tmp/weewx4_src/weewx/bin /var/tmp/weewx4_src/weewx/bin/wee_import --version
Using WeeWX configuration file /var/tmp/weewx4_src/weewx/weewx.conf
wee_import version: 0.4
Using WeeWX configuration file /var/tmp/weewx4_src/weewx/weewx.conf
Starting wee_import...Observation history for Weather Underground station 'KCAANAHE97' will be imported.Using database binding 'wx_binding', which is bound to database 'weewx.sdb'Destination table 'archive' unit system is '0x01' (US).Missing derived observations will be calculated.Starting import ...Records covering multiple periods have been identified for import.256 records identified for import.Proceeding will save all imported records in the WeeWX archive.
Unique records processed: 250; Last timestamp: 2020-01-06 20:49:52 PST (15783725Unique records processed: 256; Last timestamp: 2020-01-06 21:19:48 PST (1578374388)Calculating missing derived observations ...Processing record: 256; Last record: 2020-01-07 00:00:00 PST (1578384000)Recalculating daily summaries...Finished recalculating daily summariesFinished calculating missing derived observationsFinished import256 records were processed and 256 unique records imported in 30.47 seconds.Those records with a timestamp already in the archive will not have beenimported. Confirm successful import in the WeeWX log file.
Using configuration file /var/tmp/weewx4_src/weewx/weewx.confUsing database binding 'wx_binding', which is bound to database 'archive_sqlite'Checking daily summary tables version...Daily summary tables are at version 2.0Interval Weighting Fix is not required.Daily summary tables version check completed in 0.01 seconds.Preparing Null String Fix, this may take a while...Checking record: 1408; Timestamp: 2020-01-06 21:19:48 PST (1578374388)No null strings found.Completed Null String Check in 0.09 seconds.
Using configuration file /var/tmp/weewx4_src/weewx/weewx.confGenerating for all time
Jan 6 21:37:14 www2 journal: wee_import[32763] INFO weeimport.wuimport: Using database binding 'wx_binding', which is bound to database 'weewx.sdb'Jan 6 21:37:15 www2 journal: wee_import[32763] INFO weewx.manager: Added record 2020-01-05 00:04:50 PST (1578211490) to database 'weewx.sdb'Jan 6 21:37:15 www2 journal: wee_import[32763] INFO weewx.manager: Added record 2020-01-05 00:04:50 PST (1578211490) to daily summary in 'weewx.sdb'*** Multiple lines nipped for conciseness ***Jan 6 21:37:18 www2 journal: wee_import[32763] INFO weewx.manager: Added record 2020-01-05 23:59:48 PST (1578297588) to database 'weewx.sdb'Jan 6 21:37:18 www2 journal: wee_import[32763] INFO weewx.manager: Added record 2020-01-05 23:59:48 PST (1578297588) to daily summary in 'weewx.sdb'Jan 6 21:37:18 www2 journal: wee_import[32763] INFO weewx.wxservices: The following values will be calculated: altimeter=prefer_hardware, appTemp=prefer_hardware, barometer=prefer_hardware, beaufort=prefer_hardware, cloudbase=prefer_hardware, dewpoint=prefer_hardware, ET=prefer_hardware, heatindex=prefer_hardware, humidex=prefer_hardware, inDewpoint=prefer_hardware, maxSolarRad=prefer_hardware, pressure=prefer_hardware, rainRate=prefer_hardware, windchill=prefer_hardware, windrun=prefer_hardwareJan 6 21:37:18 www2 journal: wee_import[32763] INFO weewx.wxservices: The following algorithms will be used for calculations: altimeter=aaASOS, maxSolarRad=RSJan 6 21:37:20 www2 journal: wee_import[32763] INFO weewx.manager: Starting backfill of daily summariesJan 6 21:37:20 www2 journal: wee_import[32763] INFO weewx.manager: Processed 288 records to backfill 1 day summaries in 0.51 secondsJan 6 21:37:30 www2 wee_reports[300]: copygenerator: copied 9 files to /www/html/weewx
PYTHONPATH=/var/tmp/weewx4_src/weewx/bin /var/tmp/weewx4_src/weewx/bin/wee_import --import-config=/var/tmp/wu.confUnique records processed: 250; Last timestamp: 2020-01-06 20:49:52 PST (15783725Unique records processed: 256; Last timestamp: 2020-01-06 21:19:48 PST (1578374388)Jan 6 21:37:18 www2 journal: wee_import[32763] INFO weewx.manager: Added record 2020-01-05 23:59:48 PST (1578297588) to database 'weewx.sdb'PYTHONPATH=/var/tmp/weewx4_src/weewx/bin /var/tmp/weewx4_src/weewx/bin/wee_import --import-config=/var/tmp/wu.conf --from=2019-05-20T07:00 --to=2019-05-20T23:59
--- just a couple log entries ---
Jan 6 21:22:55 www2 journal: wee_import[31892] INFO weewx.manager: Added record 2019-05-20 23:54:48 PDT (1558421688) to database 'weewx.sdb'
Jan 6 21:22:55 www2 journal: wee_import[31892] INFO weewx.manager: Added record 2019-05-20 23:54:48 PDT (1558421688) to daily summary in 'weewx.sdb'
A ton of successful hits, but the html did not update.
PYTHONPATH=/var/tmp/weewx4_src/weewx/bin /var/tmp/weewx4_src/weewx/bin/wee_import --import-config=/var/tmp/wu.conf
Success again, but when I ran it a second time I see this:
Jan 6 21:43:48 www2 journal: wee_import[759] ERROR weewx.manager: Unable to add record 2020-01-06 21:19:48 PST (1578374388) to database 'weewx.sdb': PRIMARY KEY must be unique
which I believe tells me that the records were imported on the first run, but because they exist it can not import them due to the primary key exists, which is probably set to the date stamp?
PYTHONPATH=/var/tmp/weewx4_src/weewx/bin /var/tmp/weewx4_src/weewx/bin/wee_import --import-config=/var/tmp/wu.conf --date=2020-01-05
PYTHONPATH=/var/tmp/weewx4_src/weewx/bin /var/tmp/weewx4_src/weewx/bin/wee_import --import-config=/var/tmp/wu.conf --date=2020-01-04
PYTHONPATH=/var/tmp/weewx4_src/weewx/bin /var/tmp/weewx4_src/weewx/bin/wee_import --import-config=/var/tmp/wu.conf --date=2020-01-03
All of these have similar entries telling me Added records and the same fail when running a second time.
I ran 'wee_database --check' and 'wee_reports' just because I ran those in my cron job before everything broke. I was thinking one of those updated the html, and png files.
I thought about it before I ran the commands, and I could have a permission issue on the directory because the cron ran as root, so I logged in as root before issuing the commands. Might have to go back in and fix some permissions after, but running as root should have resolved any permission issues. However when I cd to the weewx directory on my web server and issue:
lynx index.html
-----
05/20/2019 07:04:57 AM
Current Conditions
Outside Temperature 57.6°F
Wind Chill 57.6°F
-----
the previous date is shown in the html. :(
Good eye!!! You are quite correct! My bad again. I have actually issued a few import commands:PYTHONPATH=/var/tmp/weewx4_src/weewx/bin /var/tmp/weewx4_src/weewx/bin/wee_import --import-config=/var/tmp/wu.conf --from=2019-05-20T07:00 --to=2019-05-20T23:59
--- just a couple log entries ---
Jan 6 21:22:55 www2 journal: wee_import[31892] INFO weewx.manager: Added record 2019-05-20 23:54:48 PDT (1558421688) to database 'weewx.sdb'
Jan 6 21:22:55 www2 journal: wee_import[31892] INFO weewx.manager: Added record 2019-05-20 23:54:48 PDT (1558421688) to daily summary in 'weewx.sdb'
A ton of successful hits, but the html did not update.
---
PYTHONPATH=/var/tmp/weewx4_src/weewx/bin /var/tmp/weewx4_src/weewx/bin/wee_import --import-config=/var/tmp/wu.conf
Success again, but when I ran it a second time I see this:
Jan 6 21:43:48 www2 journal: wee_import[759] ERROR weewx.manager: Unable to add record 2020-01-06 21:19:48 PST (1578374388) to database 'weewx.sdb': PRIMARY KEY must be unique
which I believe tells me that the records were imported on the first run, but because they exist it can not import them due to the primary key exists, which is probably set to the date stamp?
PYTHONPATH=/var/tmp/weewx4_src/weewx/bin /var/tmp/weewx4_src/weewx/bin/wee_import --import-config=/var/tmp/wu.conf --date=2020-01-05
PYTHONPATH=/var/tmp/weewx4_src/weewx/bin /var/tmp/weewx4_src/weewx/bin/wee_import --import-config=/var/tmp/wu.conf --date=2020-01-04
PYTHONPATH=/var/tmp/weewx4_src/weewx/bin /var/tmp/weewx4_src/weewx/bin/wee_import --import-config=/var/tmp/wu.conf --date=2020-01-03
All of these have similar entries telling me Added records and the same fail when running a second time.
I ran 'wee_database --check' and 'wee_reports' just because I ran those in my cron job before everything broke. I was thinking one of those updated the html, and png files.
I thought about it before I ran the commands, and I could have a permission issue on the directory because the cron ran as root, so I logged in as root before issuing the commands. Might have to go back in and fix some permissions after, but running as root should have resolved any permission issues. However when I cd to the weewx directory on my web server and issue:
lynx index.html