I was a little addicted to using the library pykakasi that can convert kanji to romaji, so make a note
pip install Add the following description to requirements.txt
requirements.txt
pykakasi==0.23
Install as usual
% pip3 install -r ./requirements.txt
I was able to install it, but it fails at runtime. FileNotFoundError: [Errno 2] No such file or directory: '/Users/hira/.virtualenvs/env1/lib/python3.4/site-packages/pykakasi/hepburnhira2.pickle' It seems. The conversion table is not installed.
I couldn't help it, so I decided to build it myself without using pip.
% git clone https://github.com/miurahr/pykakasi.git
% workon env1
% python setup.py build install install_lib
from pykakasi import kakasi
kakasi = kakasi()
kakasi.setMode('H', 'a')
kakasi.setMode('K', 'a')
kakasi.setMode('J', 'a')
conv = kakasi.getConverter()
print(conv.do('Its a sunny day')) // honjitsuhaseitennari
I built it myself without using pip and it worked fine. If you leave pykakasi == 0.23 in requirements.txt, it will not work again the next time you pip install, so Restore requirements.txt.
Please let me know if there is a way to install it from pip and use it normally.
Recommended Posts