# weeWX: Installation on macOS systems

This is a guide to installing weeWX on macOS.

## Download

Download the source archive weewx-X.Y.Z.tar.gz from weewx.com/downloads.

## Install prerequisites

Ensure that Python2 is installed. Python 2.6 or 2.7 will work, but Python 3 will not.

    python -V

Make sure that pip has been installed on your system. If not, it may be as simple as:

    sudo easy_install pip

Now install the required Python packages using pip.

    sudo pip install pysqlite
    sudo pip install configobj
    sudo pip install Cheetah
    sudo pip install PIL
    sudo pip install pyserial
    sudo pip install pyusb
    sudo pip install pyephem

Depending on the macOS and Python versions, you might have to use Pillow instead of PIL.

If the PIL or Cheetah installation fails, you might have to install xcode:

    xcode-select --install

then try the pip install again.

## Install weeWX

Expand the source archive:

    tar xvfz weewx-X.Y.Z.tar.gz

Change directory:

    cd weewx-X.Y.Z

Modify home in setup.cfg to set the installation location to /Users/Shared/weewx

    perl -pi -e 's%^home.*%home = /Users/Shared/weewx%' setup.cfg

Install:

    python setup.py install

The installer will prompt for a location, latitude/longitude, altitude, station type, and parameters specific to the station.

## Run

Run the main program directly:

    cd /Users/Shared/weewx
    ./bin/weewxd weewx.conf

Or as a daemon automatically when the computer starts:

    sudo cp /Users/Shared/weewx/util/launchd/com.weewx.weewxd.plist /Library/LaunchDaemons
    sudo launchctl load /Library/LaunchDaemons/com.weewx.weewxd.plist

## Status

To make sure things are running properly, look in the system log for messages from weeWX. Run the Console application and select All Messages.

## Verify

After about 5 minutes, open the station web page in a web browser. You should see your station information and data. If your hardware supports hardware archiving, then how long you wait will depend on the archive interval set in your hardware.

    file:///Users/Shared/weewx/public_html/index.html

## Customize

To enable uploads such as Weather Underground or to customize reports, modify the configuration file /Users/Shared/weewx/weewx.conf. See the User Guide and Customization Guide for details.

WeeWX must be restarted for configuration file changes to take effect.

## Start/Stop

To start/stop weeWX:

    sudo launchctl load /Library/LaunchDaemons/com.weewx.weewxd.plist
    sudo launchctl unload /Library/LaunchDaemons/com.weewx.weewxd.plist

## Uninstall

To uninstall, simply delete the directory /Users/Shared/weewx. This will delete weeWX, configuration files, and data.

    rm -r /Users/Shared/weewx
    sudo rm /Library/LaunchDaemons/com.weewx.weewxd.plist

## Layout

The instructions above will result in the following layout:

executable: | /Users/Shared/weewx/bin/weewxd
configuration file: | /Users/Shared/weewx/weewx.conf
skins and templates: | /Users/Shared/weewx/skins/
sqlite databases: | /Users/Shared/weewx/archive/
generated web pages and images: | /Users/Shared/weewx/public_html/
documentation: | /Users/Shared/weewx/docs/
examples: | /Users/Shared/weewx/examples/
utilities: | /Users/Shared/weewx/bin/wee_*

© Copyright Tom Keffer