grabear / Raspbian-ShinyServerAndPython36

Installation scripts for Python 3.6.2 and Shiny-Server
7 stars 5 forks source link
bash data-science python3 python3-6-2 python36 r raspberry-pi-3 raspbian raspbian-stretch rshiny shell shiny shiny-apps shiny-server

Install Shiny Server and Python 3.6.0 on Raspbian

Overview

The purpose for this project is to install Shiny Server and Python on the Raspian OS for Raspberry Pi.

Pre-Requisites:

The current setup has been tested on Raspbian Stretch with a Raspberry Pi 3 Model B. The installation will take some time; especially over wifi. It is recommended to run this over ethernet.

It's recommended to run the installation one step at a time OR do the full installation when you have several hours to allow it to complete.

Full Installation

To run the full installation use master-install.sh. Again, recommended to do this overnight or when you can dedicate several hours for completion.

The following software will be installed with the full installation:

To run full installation:

pi@raspberrypi $ . master-install.sh

Python 3.6.2 Installation

Python 3.6.2 installation on Raspbian was inspired by this Gist.

To install python 3.6.2:

pi@raspberrypi $ . master-python3.6.2-install.sh

This installation script also installs the PyPI packages in requirements.txt file. If you do not desire these packages, then comment out the following lines in the py3.6.2-install.sh file:

sudo apt-get -y autoremove
sudo apt-get -y clean

# Install python packages
# cd $DIR
# pip install -r requirements.txt

# Update system
sudo apt-get -y update
sudo apt-get -y upgrade

Alternatively, you can rewrite the requirements.txt file to fit your own needs.

Note: At the time of writing this guide Python 3.6.2 was the latest release. If a newer release is available via the python website, then please make a pull request that changes the various file names and code. You may also feel free to manually change them yourself.

R Installation

To install R :

pi@raspberrypi $ . master-R-install.sh

Shiny-Server Installation

Shiny-Server installation on Raspbian was inspired by R-Studio's guide here.

To install Shiny-Server:

pi@raspberrypi $ . master-shiny-server-install.sh

After shiny server is installed it will automatically run on reboot. In order to remove this functionality comment out the following lines in the shiny-server.service file:

[Service]
Type=simple
ExecStart=/usr/bin/shiny-server
#Restart=always

ExecReload=/bin/kill -HUP $MAINPID
ExecStopPost=/bin/sleep 5
RestartSec=1

[Install]
WantedBy=multi-user.target

Future Release Features