My system still has Python2 installed. I also have Python-3.8.1. Here's 
what I had to do to get weewx 4.0.0b12 working on my system, which supports 
both python2 and python3 simultaneously:

   1. Since "python" on my system resolves to Python2 - I had to change the 
   executable scripts in /home/weewx/bin to have hashbangs that referenced 
   /usr/bin/python3
   2. I had to install PyMySQL for Python3. MySQLdb/MySQL-Python just 
   didn't work for me. PyMySQL worked like a charm.
   3. I had to install Cheetah3.
   4. I had to install Pillow for images support. The very old "imaging" 
   package (I think v1.1.7?) didn't work for me with Python3.
   5. As to other Python packages needed for weewx under Python3, I haven't 
   checked. I had a good number installed already. The above (Cheetah3, 
   PyMySQL, Pillow) were the ones I had to install because I did not already 
   have them under Python3. 
   6. I wondered how old the stuff was in the bin/user directory - and 
   there were a couple of extensions I no longer used, which I just removed, 
   and then I upgraded my versions of __init__.py and extensions.py from the 
   4.0.0b12 source tree. To get the 'purpleair' extension working in Python3, 
   I had to make a couple of syntax edits (print is a function, not a 
   statement) and (exception handling uses the 'as' keyword). When I see the 
   'purpleair' extension working for a week or so, I will send these trivial 
   edits up-stream.
   
The above got me running on a system supporting both Python2 and Python3. 
Total work was probably about 60-90 minutes; not bad! It was nice to see 
how relatively easy it was upgrading to WeeWx 4.0, and all of the changes I 
had to make had nothing to do with the Weewx code. 

I'm scanning through the weewx doc to see if it references the newer 
Python3 modules, but with the work-week beginning, that may not happen 
right away.

At some point, when GCC 10.0 comes out, it will be time to rebuild my 
system from the ground up. (I use linuxfromscratch, which is sort of a 
'build-it-yourself step-by-step distribution.) When I do that, I am going 
to try to have a python3-only system under which to try to run Weewx.

-Joel

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-development" 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-development/dd3aefaa-b407-4d35-808d-542acdeb3d80%40googlegroups.com.

Reply via email to