-
You will need
brew
aka Homebrew for package management.Big Sur: see notes on running
brew
with Rosetta, akaibrew
below. -
It is highly recommended that you install a python environment manager. Two options are:
-
pyenv (recommended) and
pyenv-virtualenv
brew install pyenv pyenv-virtualenv
To create a new HQ virtual environment running Python 3.9.11, you can do the following:
pyenv virtualenv 3.9.11 hq
Then to enter the environment:
pyenv activate hq
-
Please note that if you use
virtualenvwrapper
, you also need to installpip
To install
pip
:sudo python get-pip.py
Then install
virtualenvwrapper
withpip
:sudo python3 -m pip install virtualenvwrapper
-
-
Java (JDK 8)
We recommend using
sdkman
as a Java environment manager.jenv
is also an option, though more involved.-
Example setup using
sdkman
:-
List available java versions to file one that matches Java (JDK 8)
sdk list java
Look for Java 8 in the list and install, eg:
sdk install java 8.0.322-zulu
-
Example setup using
jenv
:-
Download and install Java SE Development Kit 8 from oracle.com downloads page. (requires signing in with an Oracle account to download).
-
Install
jenv
brew install jenv
-
Configure your shell (Bash folks use
~/.bashrc
instead of~/.zshrc
below):echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.zshrc echo 'eval "$(jenv init -)"' >> ~/.zshrc
-
Add JDK 8 to
jenv
:jenv add $(/usr/libexec/java_home -v 1.8)
-
Verify
jenv
config:jenv doctor
-
-
-
It is recommended that you install Rosetta:
softwareupdate --install-rosetta
This allows you to install and run Brew services in x86 fashion. "Rosetta 2 is an emulator designed to bridge the transition between Intel and Apple processors. In short, it translates apps built for Intel so they will run on Apple Silicon." Link. While reading through this document, be careful to watch out for specific recommendations regarding your architecture.
-
If
brew
cannot successfully build packages on your system, you can runbrew
with Rosetta under the aliasibrew
using the method below. However, please try installing the latest version ofbrew
first, as this might also be fixed for MacOS 11.xarch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
And let's call this Rosetta-enabled Homebrew
ibrew
for short by adding this to~/.zshrc
:alias ibrew="arch -x86_64 /usr/local/bin/brew"
Note: 12.x Monterey seems to be handling
brew
just fine when following the official install guide.
-
psycopg2
will complainAs of Mac OS 11.x Big Sur, the solution for this is:
brew install libpq --build-from-source export LDFLAGS="-L/opt/homebrew/opt/libpq/lib" pip install psycopg2-binary
Docker images that will not run on Mac OS (Intel or M1):
formplayer
(See section on Running Formplayer Outside of Docker in the Main Developer Setup Guide)
Docker images that will not run on Mac OS (as of 11.x Big Sur and above):
elasticsearch2
elasticsearch5
./scripts/docker up -d postgres couch redis zookeeper kafka minio
Note: kafka
will be very cranky on start up. You might have to restart it if you see kafka
errors.
./scripts/docker restart kafka
First, ensure that you have Java 8 running. java -version
should output something like openjdk version "1.8.0_322"
.
Use sdkman
or jenv
to manage your local java versions.
Download the tar
file for elasticsearch 2.4.6
Un-tar and put the folder somewhere you can find it. Take note of tha path (pwd
) and add the following to your ~/.zshrc
:
export PATH="/path/to/elasticsearch-2.4.6/bin:$PATH"
NOTE: Make sure that /path/to
is replaced with the actual path!
After this you can open a new terminal window and run elasticsearch with elasticsearch
.
If you are sure that the following brew install libmagic
ran successfully, but you are still seeing the error below, then this section is for you!
ImportError: failed to find libmagic. Check your installation
As of Mac OS 12.x, brew
now installs itself in /opt/homebrew/
, and it looks like our version of the python package that requires libmagic
has not caught up.
To fix:
cd /usr/local/lib/
ln -s /opt/homebrew/Cellar/libmagic/5.41/lib/libmagic.dylib libmagic.dylib
FYI, be sure to check out the FAQ on elasticsearch.
To refresh specific indices in elasticsearch you can do the following...
First make sure everything is up-to-date
./manage.py ptop_preindex --reset
./manage.py ptop_es_manage --flip_all_aliases
./manage.py preindex_everything
Force a re-index of forms
and cases
:
./manage.py ptop_reindexer_v2 sql-case --reset
./manage.py ptop_reindexer_v2 sql-form --reset
For other indices see ./manage.py ptop_reindexer_v2 --help