Skip to content
This repository has been archived by the owner on Mar 30, 2024. It is now read-only.

Commit

Permalink
Add install notes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jzohrab committed Nov 10, 2023
1 parent 96f0ee0 commit 149f8f5
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 33 deletions.
1 change: 1 addition & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ language = "en"
multilingual = false
src = "src"
title = "Lute manual"
theme = "rust"

[build]
create-missing = true
34 changes: 1 addition & 33 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,7 @@
[Introduction](intro.md)

- [Background](background.md)

- [System Requirements]()
- [Common requirements]()
- [Windows]()
- [macOS]()
- [Linux]()

# Installation

- [Installation]()
- [Using pip]()
- [Using Docker]()
- [From source]()

* [Running Lute using Docker Getting-Started]()
* [Setting up Docker Setting-up-Docker]()
* [Running Lute without Docker Getting-started-without-Docker]()
* [Setting up the environment Installing-dependencies]()
* [Sqlite Install-Sqlite]()
* [PHP Install-PHP]()
* [MeCab Install-Mecab]()
* [Getting started on other systems other-systems]()
* [Raspberry Pi Getting-started-raspberry-pi]()
* [MAMP on a Mac Getting-started-mac-mamp]()
* [Podman Getting-started-with-podman]()
* [Troubleshooting Troubleshooting-Installation]()

- [Installation](install.md)

# Add: basic terms (Term, Multi-word Term, Status)

Expand Down Expand Up @@ -72,9 +46,3 @@

* [500 internal server error 500-Internal-Server-Error]()

# Misc

* [Lute alternatives Lute-alternatives]()
* [When not to use Lute When-not-to-use-Lute]()
* [Project goal Project-goal]()
* [Feature and Dev Backlog Backlog]()
79 changes: 79 additions & 0 deletions src/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Installation

There are currently three different methods to install Lute v3 on your system, with different system requirements:

* [Python package install using `pip`](install.md#using-pip)
* [Docker](install.md#using-docker)
* [From source](install.md#from-source)

> I can't recommend any particular installation method: they all have trade offs. My personal preference is to install using pip.
## Using pip

System requirements:

* Python 3.8+ and pip
* Japanese learners will also need to [install MeCab](./mecab.md)

Lute can be installed from [https://pypi.org/project/lute3/](https://pypi.org/project/lute3/). Here's a summary of the instructions on that pypi page (Linux/Mac, Windows will be similar). Note my system has python3.8, your system may vary:

```
python3.8 -m venv myenv
source myenv/bin/activate
# Install
pip install --upgrade lute3
# Start
python -m lute.main
# Open your web browser to http://localhost:5000
# When done, hit Ctl-C
deactivate
```

## Using Docker

System requirements:

* Docker

> Docker is a containerization platform that allows you to run applications in a sandboxed environment (ref the [Docker documentation](https://docs.docker.com/)). **Docker is not available or is problematic on some systems, particularly Windows.**
Lute has a pre-built docker image at [https://hub.docker.com/r/jzohrab/lute3](https://hub.docker.com/r/jzohrab/lute3). There are notes on that page about the image. Here's one way to get started using a `docker-compose.yml` file:

* create a folder on your system for your lute, with folders for the data and backups, e.g.:

```
- my_lute/
docker-compose.yml
- data/
- backups/
```

* Put the following in the `docker-compose.yml`:

```
version: '3.9'
services:
lute:
image: jzohrab/lute3:latest
ports:
- 5000:5000
volumes:
- ./data:/lute_data
- ./backups:/lute_backup
```

* open a terminal/shell in the `my_lute` folder, and start Lute:

```
docker compose up
```

## From source

Developers and gearheads can install Lute from source: see the [Lute repository](https://github.com/jzohrab/lute-v3/blob/master/docs/development.md).

If you want to develop Lute, you'll also need to [install MeCab](./mecab.md).
47 changes: 47 additions & 0 deletions src/mecab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
> Note: this is for non-Docker users studying Japanese only (or devs who are working on Lute)
Lute users who are studying Japanese will need to install MeCab and an appropriate dictionary for parsing Japanese text. If MeCab is not installed or not on your PATH, you will not be able to parse Japanese texts.

# Installation

## Mac

You can install MeCab and a dictionary using `homebrew`:

```
brew install mecab
brew install mecab-ipadic
```

## Windows

> instructions needed!
## Linux

Use apt-get:

```
sudo apt-get update -y
sudo apt-get install -y mecab mecab-ipadic-utf8
```

# Verification

Test mecab from the terminal:

```
$ mecab
すもももももももものうち
すもも 名詞,一般,*,*,*,*,すもも,スモモ,スモモ
も 助詞,係助詞,*,*,*,*,も,モ,モ
もも 名詞,一般,*,*,*,*,もも,モモ,モモ
```

Windows users may need to type the full path.

# Lute configuration

If everything is installed correctly, you will see a Japanese sample story when you start Lute. If you _don't_ see that story, then either your MeCab isn't set up correctly, or Lute can't find it.

Lute uses a library called [natto-py](https://github.com/buruzaemon/natto-py) that _usually_ finds and uses MeCab automatically. If it can't, you'll need to specify the path to your MeCab library in Lute's Settings (top right menu bar). There is a box for you to enter your MeCab path and do a test parse. If that test succeeds, you're good to go. If not, jump into the Lute Discord.

0 comments on commit 149f8f5

Please sign in to comment.