When I want to do morphological analysis with Python, I sometimes use MeCab for the time being. However, it is not an easy thing to use immediately if you write one line like this MeCab, pip install MeCab
, so it is a little troublesome when you want to run it in other environments. I made a note because I made some trial and error.
--Use Virtualenv --Do not use what you put in your system with ʻapt-get install python-mecab`
Specify the version of all mecabs installed on the system.
yml:.travis.yml
before_install:
- sudo apt-get update -qq
- wget http://ftp.sjtu.edu.cn/ubuntu/pool/universe/m/mecab/libmecab2_0.996-1.1_amd64.deb
- sudo dpkg -i libmecab2_0.996-1.1_amd64.deb
- wget http://ftp.sjtu.edu.cn/ubuntu/pool/universe/m/mecab/libmecab-dev_0.996-1.1_amd64.deb
- sudo dpkg -i libmecab-dev_0.996-1.1_amd64.deb
- wget http://ftp.sjtu.edu.cn/ubuntu/pool/universe/m/mecab/mecab-utils_0.996-1.1_amd64.deb
- sudo dpkg -i mecab-utils_0.996-1.1_amd64.deb
- sudo apt-get install -y mecab-ipadic-utf8
language: python
python:
- "2.7"
install:
- "pip install -r requirements.txt"
script: "python tests.py"
requirements.txt
https://mecab.googlecode.com/files/mecab-python-0.996.tar.gz
moved https://travis-ci.org/hagino3000/mecab-deploy-test