I tried using the Python library "pykakasi" that can convert kanji to romaji.

at first

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

But it doesn't work

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.

Build your own

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

moved.

  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

After all

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.

At the end

Please let me know if there is a way to install it from pip and use it normally.

Recommended Posts

I tried using the Python library "pykakasi" that can convert kanji to romaji.
I tried using the Python library from Ruby with PyCall
Miscellaneous notes that I tried using python for the matter
[Python] I tried to make a simple program that works on the command line using argparse.
I tried using "Streamlit" which can do the Web only with Python
I tried to analyze the New Year's card by myself using python
vprof --I tried using the profiler for Python
I tried using the Datetime module by Python
I tried using the functional programming library toolz
[Python] I tried to judge the member image of the idol group using Keras
I tried to create a class that can easily serialize Json in Python
[Python] Deep Learning: I tried to implement deep learning (DBN, SDA) without using a library.
I tried to graph the packages installed in Python
I tried to touch the CSV file with Python
I tried to solve the soma cube with python
I wanted to use the Python library from MATLAB
I tried to approximate the sin function using chainer
[Python] I tried to graph the top 10 eyeshadow rankings
[Python] A convenient library that converts kanji to hiragana
I tried to solve the problem with Python Vol.1
I felt that I ported the Python code to C ++ 98.
I tried to identify the language using CNN + Melspectogram
I tried to access Google Spread Sheets using Python
I tried to complement the knowledge graph using OpenKE
I tried to compress the image using machine learning
I tried to summarize the string operations of Python
A story that was convenient when I tried using the python ip address module
Python practice 100 knocks I tried to visualize the decision tree of Chapter 5 using graphviz
I tried to score the syntax that was too humorous and humorous using the COTOHA API.
mong --I tried porting the code that randomly generates Docker container names to Python -
I tried the changefinder library!
[Python] I tried using OpenPose
I tried to simulate ad optimization using the bandit algorithm.
[Python] I tried to visualize the follow relationship of Twitter
I tried to implement the mail sending function in Python
[TF] I tried to visualize the learning result using Tensorboard
[Python] I tried collecting data using the API of wikipedia
I tried to enumerate the differences between java and python
I tried to make a stopwatch using tkinter in python
I tried changing the python script from 2.7.11 to 3.6.0 on windows10
I tried to divide the file into folders with Python
I tried to approximate the sin function using chainer (re-challenge)
I tried to output the access log to the server using Node.js
I tried using a library (common thread) that makes Python's threading package easier to use
I tried to touch Python (installation)
[Python] How to import the library
I tried using Thonny (Python / IDE)
I tried to move the ball
I tried using the checkio API
[Python] I tried using YOLO v3
I tried to estimate the interval.
I tried to solve the ant book beginner's edition with python
[Python] I made my own library that can be imported dynamically
I tried Python! ] Can I post to Kaggle on my iPad Pro?
I tried to convert a Python file to EXE (Recursion error supported)
I tried running the Python Package Repository (Warehouse) that supports PyPI
I tried to get the index of the list using the enumerate function
Movement that changes direction in the coordinate system I tried Python 3
I tried using the python module Kwant for quantum transport calculation
I created a Python library to call the LINE WORKS API
I tried to make a regular expression of "time" using Python