Tested on a Raspberry Pi 4 with 8GB RAM.
Whatever else you do, make sure you are using a 64-bit OS. The combination of the arm archtecture and a 32-bit OS will greatly limit package support.
Rasberry Pi OS is based on Debian, and very recently released a 64-bit version.
Ubuntu for Raspberry Pi 64-bit is another choice.
These instructions were tested on Rasberry Pi OS 64-bit.
sudo apt-get install python3-dev default-libmysqlclient-dev build-essentials mariadb-client mariadb-server
conda create --name BookwormDB python=3.7
conda activate BookwormDB
git clone https://github.com/Bookworm-project/BookwormDB
cd BookwormDB
pip install .
New versions (2.1.0 and up) of mysqlclient deprecated neccessary functions such as escape_string()
.
pip install mysqlclient==2.0.3
pip install regex
sed -i 's/import re/import regex as re/g' tokenizer.py
Or by hand:
nano [your environment]/lib/python3.7/site-packages/bookwormDB/tokenizer.py
change: import re
to: import regex as re
...on line 13.
(This may not be neccessary in Python 3.8 but we are using Python 3.7 here.)
Versions of MariaDB 10.4 and higher don't use traditional passwords anymore. We need to go back to the future.
sudo mysql
(no user or password needed initially since modern MariaDB uses Unix sockets to authenticate by default.)
ALTER USER root@localhost IDENTIFIED VIA mysql_native_password USING PASSWORD("");
exit
This is of course very insecure.
mkdir [name of your bookworm]
mv input.txt [name of your bookworm]/
mv jsoncatalog.txt [name of your bookworm]/
mv field_descriptions.json [name of your bookworm]/
cd [name of your bookworm]
bookworm init
clear; bookworm --log-level debug build all
bookworm serve
Visit http://localhost:10012/ to verify.
nano [your environment]/lib/python3.7/site-packages/bookwormDB/wsgi.py
At the end of the file:
options = {
'bind': '{}:{}'.format('127.0.0.1', port),
'workers': workers,
}
... change 127.0.0.1
to the ip address of the Pi.