Settings when you want to run python-mecab with travis

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.

policy

--Use Virtualenv --Do not use what you put in your system with ʻapt-get install python-mecab`

Setting

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

result

moved https://travis-ci.org/hagino3000/mecab-deploy-test

Recommended Posts

Settings when you want to run python-mecab with travis
When you want to filter with Django REST framework
Solution when you want to use cv_bridge with python3 (virtualenv)
[AWS] What to do when you want to pip with Lambda
Use aggdraw when you want to draw beautifully with pillow
When you want to register Django's initial data with relationships
When you want to print to standard output with print while testing with pytest
When you want to send an object with requests using flask
[TensorFlow] If you want to run TensorBoard, install it with pip
When you want to adjust the axis scale interval with APLpy
When you want to use it as it is when using it with lambda memo
Gist repository to use when you want to try a little with ansible
When you want to replace a column with a missing value (NaN) column by column
Memorandum of means when you want to make machine learning with 50 images
When you want to update the chrome driver.
Personal best practice template to use when you want to make MVP with Flask
[OpenCV] When you want to check if it is read properly with imread
Links to do what you want with Sublime Text
When you want to play a game via Proxy
Things to do when you start developing with Django
When you want to plt.save in a for statement
I want to run a quantum computer with Python
When the variable you want to superscript with matplotlib is two or more characters
To run gym_torcs with ubutnu16
[Django] A memorandum when you want to communicate asynchronously [Python3]
Knowledge you need to know when programming competitive programming with Python2
[AWS EC2] Settings you want to do on Amazon Linux 2
When you want to use python2.x on modern Gentoo Linux
When you want to hit a UNIX command on Python
I know? Data analysis using Python or things you want to use when you want with numpy
Useful operation when you want to solve all problems in multiple programming languages with Codewars
If you want to use field names with hyphens when updating firestore data in python
[Subprocess] When you want to execute another Python program in Python code
If you want to become a data scientist, start with Kaggle
Don't write Python if you want to speed it up with Python
Nice to meet you with python
When it is troublesome to copy what you built with vue
When you want to keep the Sphinx documentation theme as usual
I want to run Rails with rails s even in vagrant environment
I want to run the Python GUI when starting Raspberry Pi
How to run Jupyter and Spark on Mac with minimal settings
[Python] When you want to use all variables in another file
UnicodeEncodeError when trying to run radon
When you want to save the result of the callback function somewhere
Key operations you want to know
When you run diff in python and want both returncode and output
I want to do ○○ with Pandas
Until you run python with apache
When you want to sort a multidimensional list by multiple lines
How to deal with the error "Failed to load module" canberra-gtk-module "that appears when you run OpenCV
I want to debug with Python
I want to get angry with my mom when my memory is tight
[Introduction to machine learning] Until you run the sample code with chainer
If you want to include awsebcli with CircleCI, specify the python version
18 beautiful Python terms you want to read aloud. R18 with example sentences
Python Note: When you want to know the attributes of an object
When you want to change the HTTP headers of Flask's test client
If you want to get multiple statistics with groupby in pandas v1
Wrapper when you want to output utf-8 + ansi color on Windows console
I want to detect objects with OpenCV
I want to blog with Jupyter Notebook