macOS WeeWX Guides >>>
Upgrading to Sierra with Weewx
These instructions work on MAC OSX Sierra, and document the changes that I had to make to allow WeeWX run in the new OS.
It is assumed that you already have a working copy of WeeWX that was installed on a previous version of macOS and so this page simply documents the changes that i had to make.
The Challenge
PIL, was a challenge to install on previous versions of macOS, but no longer installs on the Sierra. Whilst the upgrade does keep the necessary libraries it does result in some rendering challenges and so I have modified my installation to use pillow instead.
Installation
First you need to install pip, and then use this interface to remove PIL and replace it with pillow..
$ sudo easy_install pip Password: Searching for pip Reading https://pypi.python.org/simple/pip/ Best match: pip 9.0.1 Downloading https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9 Processing pip-9.0.1.tar.gz . . . creating /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg Extracting pip-9.0.1-py2.7.egg to /Library/Python/2.7/site-packages Adding pip 9.0.1 to easy-install.pth file Installing pip script to /usr/local/bin Installing pip2.7 script to /usr/local/bin Installing pip2 script to /usr/local/bin Installed /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg Processing dependencies for pip Finished processing dependencies for pip $ sudo pip uninstall PIL The directory '/Users/Mike/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Uninstalling PIL-1.1.7: /Library/Python/2.7/site-packages/PIL-1.1.7-py2.7-macosx-10.11-intel.egg /usr/local/bin/pilconvert.py /usr/local/bin/pildriver.py /usr/local/bin/pilfile.py /usr/local/bin/pilfont.py /usr/local/bin/pilprint.py Proceed (y/n)? y Successfully uninstalled PIL-1.1.7 $ sudo pip install pillow Collecting pillow Downloading Pillow-5.0.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (3.5MB) 100% |████████████████████████████████| 3.5MB 420kB/s Installing collected packages: pillow Successfully installed pillow-5.0.0
Then recompile the python code
$ sudo rm /Websites/Weewx/weewx/bin/*.pyc $ sudo rm /Websites/Weewx/weewx/bin/weeplot/*.pyc $ sudo rm /Websites/Weewx/weewx/bin/weewx/*.pyc $ sudo python -m compileall . Listing . ... Compiling ./daemon.py ... Listing ./examples ... Listing ./schemas ... Listing ./user ... Listing ./weecfg ... Listing ./weedb ... Listing ./weeplot ... Compiling ./weeplot/__init__.py ... Compiling ./weeplot/genplot.py ... Compiling ./weeplot/utilities.py ... Listing ./weeutil ... Listing ./weewx ... Compiling ./weewx/__init__.py ... Compiling ./weewx/accum.py ... Compiling ./weewx/almanac.py ... Compiling ./weewx/cheetahgenerator.py ... Compiling ./weewx/crc16.py ... Listing ./weewx/drivers ... Compiling ./weewx/engine.py ... Compiling ./weewx/filegenerator.py ... Compiling ./weewx/imagegenerator.py ... Compiling ./weewx/junk.py ... Compiling ./weewx/manager.py ... Compiling ./weewx/reportengine.py ... Compiling ./weewx/restx.py ... Compiling ./weewx/station.py ... Compiling ./weewx/tags.py ... Compiling ./weewx/units.py ... Compiling ./weewx/uwxutils.py ... Compiling ./weewx/wxengine.py ... Compiling ./weewx/wxformulas.py ... Compiling ./weewx/wxmanager.py ... Compiling ./weewx/wxservices.py ...
Before restarting WeeWX to pick up the changes
$ /Websites/Weewx/Scripts/CheckWeewx Password: { "StandardOutPath" = "/Library/Logs/weewx.log"; "LimitLoadToSessionType" = "System"; "StandardErrorPath" = "/Library/Logs/weewx_error.log"; "Label" = "com.weewx.weewxd"; "TimeOut" = 30; "OnDemand" = false; "LastExitStatus" = 0; "PID" = 131; "Program" = "/Groups/revitt/Daemons/weewx_wrapper.sh"; "ProgramArguments" = ( "/Groups/revitt/Daemons/weewx_wrapper.sh"; "/usr/bin/python"; "/Groups/revitt/WebSites/Weewx/bin/weewxd"; "/Groups/revitt/WebSites/Weewx/weewx.conf"; "--exit"; ); }; $ /Websites/Weewx/Scripts/StopWeewx $ /Websites/Weewx/Scripts/CheckWeewx Could not find service "com.weewx.weewxd" in domain for system $ /Websites/Weewx/Scripts/StartWeewx $ /Websites/Weewx/Scripts/CheckWeewx { "StandardOutPath" = "/Library/Logs/weewx.log"; "LimitLoadToSessionType" = "System"; "StandardErrorPath" = "/Library/Logs/weewx_error.log"; "Label" = "com.weewx.weewxd"; "TimeOut" = 30; "OnDemand" = false; "LastExitStatus" = 0; "PID" = 97188; "Program" = "/Groups/revitt/Daemons/weewx_wrapper.sh"; "ProgramArguments" = ( "/Groups/revitt/Daemons/weewx_wrapper.sh"; "/usr/bin/python"; "/Groups/revitt/WebSites/Weewx/bin/weewxd"; "/Groups/revitt/WebSites/Weewx/weewx.conf"; "--exit"; ); };
Test Changes
Because PIL was not working correctly on Sierra I was getting spurious characters in my graphs as shown below

Which is fixed now that I am using pillow
