From b30bb0a83f40752825a4335c9f1b81087ae0bf17 Mon Sep 17 00:00:00 2001 From: Kenny Song Date: Mon, 19 Feb 2024 13:53:43 +0000 Subject: [PATCH] Add installation instructions --- docs/installation.md | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/docs/installation.md b/docs/installation.md index 31a6314c..2d67c6ba 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -12,4 +12,41 @@ LangCheck works with Python 3.8 or higher. Model files are lazily downloaded the first time you run a metric function. For example, the first time you run the ``langcheck.metrics.sentiment()`` function, LangCheck will automatically download the Twitter-roBERTa-base model. ::: -To install LangCheck directly from the repository source, see [the Contributing page](contributing.md). +To install LangCheck from source, see [the Contributing page](contributing.md). + +## Installation FAQ + +Depending on your environment, you might need to install additional system libraries for `pip install langcheck` to work. + +If you have any problems installing LangCheck, please check the FAQ below or [open an issue on GitHub](https://github.com/citadel-ai/langcheck/issues). + +### 1. Installing LangCheck with Python 3.12 + +As of February 2024, one of LangCheck's Japanese dependencies, [`fugashi`](https://github.com/polm/fugashi), doesn't provide wheels for Python 3.12, so you'll need to first install MeCab for pip to successfully build `fugashi`. + +**Installing MeCab on Linux (Debian/Ubuntu)** + +```bash +sudo apt-get update +sudo apt-get install -y mecab libmecab-dev mecab-ipadic-utf8 +``` + +**Installing MeCab on macOS** + +```bash +brew install mecab +``` + +**Installing MeCab on Windows** + +We haven't tested LangCheck on Windows with Python 3.12, but it may work if you install MeCab with [the official installer](https://taku910.github.io/mecab/#install). + +### 2. The error message `command 'gcc' failed` + +As of February 2024, one of LangCheck's Japanese dependencies, [`dartsclone`](https://github.com/s-yata/darts-clone), doesn't provide wheels for Python 3.10+. You'll need to have `gcc` installed for pip to successfully build `dartsclone`. + +Most systems already have `gcc` installed, with the exception of "slim" Docker images such as [`python:3.11-slim-buster`](https://hub.docker.com/_/python). If you're using this image, you can: + +1. Use `python:3.11-buster` instead of `python:3.11-slim-buster`, which includes gcc. +1. Run `apt update && apt install build-essential -y` (e.g. in your Dockerfile) to install gcc. +