Closed csparpa closed 5 years ago
Hi @patcas this commit 632764a04f4741a1042ece75ad756d5634fc0ab2 should fix the issue.. please can you test it out? Thanks
Hi @csparpa very many thanks for that! I have tried to test but I'm afraid that my git expertise probably isn't good enough. What I did was:
git clone https://github.com/csparpa/pyowm.git cd pyowm git checkout 632764a sudo python3 setup.py install
Then I ran my Python code from the Thonny IDE. But with no difference in the output -- even the code line numbers! What have I done wrong? Any help gratefully received!
What I would do then is avoid using the IDE (let's tear off one layer of complexity) and test patch from a "quick" command line script
As far as the installation is concerned, did you remove the previous pyowm
installation before performing the setup actions you that reported? Just go with: sudo pip uninstall pyowm
and then re-execute your commands
... or, alternatively, you can choose not to python3 setup.py install
the library and just import the library from the script, which you need then to put eg. inside the pyowm
root folder
Please let me know!
Success! Very many thanks, indeed, @csparpa !
I hadn't removed the previous pyowm, so I didsudo pip3 uninstall pyowm
and that appeared to work. But running my code produced the previous error. I looked in /home/pi/.local/lib/python3.5/site-packages/pyowm
and there still seemed to be a lot of files in there.
Anyway, I copied my code into /home/pi/pyowm
(the directory I had cloned the package to. Ran it from there and it was great:
`2018-11-08 20:00:00
2018-11-08 20:59:59
SELECT AVG(AMBIENT_TEMPERATURE) FROM WEATHER_MEASUREMENT WHERE CREATED BETWEEN '2018-11-08 20:00:00' AND '2018-11-08 20:59:59.999999'
6.317531
2018-11-08 21:00:00
1541710800
<class 'int'>
<pyowm.stationsapi30.measurement.Measurement - station_id=5bdda367199f0300011f2b11, created_at=1541710800> ` So, many thanks again, much appreciated! My next task is to get the other measurements working and then upload on a regular basis...
well done! thanks for testing it. and, by the way, I've added your GitHub handle to the CONTRIBUTORS.md file!
User Patrick Casbon reports errors when sending measurements to the Stations API:
The issue might be related to line: https://github.com/csparpa/pyowm/blob/1b8632b4a7bfd74c0231d7954e813939c9d7c389/pyowm/stationsapi30/measurement.py#L199
This method is not dumping the Measurement object in the right way and therefore a wrong JSON is actually sent to the Openweathermap API