MacOS Setup Documentation

Contents

Install Crafty on macOS

These instructions will guide you to install Crafty on macOS.

Requirements & Assumptions

Installation

1. Install Pre-Requisites
Brew.sh

macOS lacks a proper package manager and in order to install a couple of the required software via the command line you will need Brew.sh.

Go to your /Applications/Utilities and launch Terminal.app or press Command+Space and type Terminal.app and hit return/enter key. Then paste the line below:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

The command above runs and you will see the installation progress. It will inform you that the Command Line Tools for Xcode will get installed.

Towards the end you will be asked to enter your account password then the installation will continue.

You will be notified when Brew begins downloading the Command Line Tools for Xcode and depending on your connection the download will take about 5 minutes. Once the tools have downloaded, they will install on your mac and the installation of Brew will be completed.

Installing Pre-Requisite Packages

This guide assumes you have the following software installed and up to date: Git, Python 3.7, and Java (Open JDK is fine).

First, install Git and Python 3.75

brew install git python3

then OpenJDK

brew cask install java

then upgrade pip

pip install --upgrade pip
2. Installing Crafty
Create a directory for Crafty

Let's make crafty a place to live on your server. This guide will use /var/opt/minecraft/crafty as it's example:

sudo mkdir -p /var/opt/minecraft/crafty
Setup permissions for the folder
sudo chown <your_username>:admin /var/opt/minecraft/crafty

For Example If your username on your mac is Totoro then the command will be: sudo chown totoro:admin /var/opt/minecraft/crafty

Change to the Crafty dir
cd /var/opt/minecraft/crafty
Create a virtual environment "venv"
python3 -m venv venv
Clone Crafty Repo

Please be sure to be in the crafty folder before cloning the repo. To check type pwd and make sure it says /var/opt/minecraft/crafty before you continue.

git clone https://gitlab.com/crafty-controller/crafty-4.git

Switch to the crafty-4 directory

cd /var/opt/minecraft/crafty/crafty-4

Then lets make sure we are on the latest snapshot and lets checkout

git pull
git checkout master

Let's go up one directory

cd ..
Activate the Virtual Environment

Lets activate the Virtual Environment

source venv/bin/activate

your prompt will change to (venv) whateveryourprompt is:

Go into the crafty-4 folder that was cloned down
cd /var/opt/minecraft/crafty/crafty-4
Install all the things / requirements
pip install -r requirements.txt
Run Crafty
python crafty.py
How to Update
For updating you are going to repeat some steps listed above, but since you already must have done this before, the steps are listed below, just do them in that order. Please be sure to be in the crafty folder before cloning the repo. To check type pwd and make sure it says /var/opt/minecraft/crafty before you continue.
git clone https://gitlab.com/crafty-controller/crafty-4.git
cd /var/opt/minecraft/crafty/crafty-4
git pull
git checkout master
cd ..
source venv/bin/activate
cd /var/opt/minecraft/crafty-4
pip install -r requirements.txt
python crafty.py

Post-Install

Check out the Getting Started page.