I'd like to convert Japanese to romaji using pykakasi in python.
When I try to do it, I get the following error:
KeyError: 'pykakasi\\hepburnhira2.pickle'
There was information that pykakasi gets an error when installing with pip, so
I installed it directly from the github repository without using pip.
from pykakasi import kakasi
kakasi=kakasi()
kakasi.setMode('H', 'a')
kakasi.setMode('K', 'a')
kakasi.setMode('J', 'a')
conv=kakasi.getConverter()
result=conv.do("Japanese")
print(result)
Has anyone solved the same problem?
python python3 pykakasi
If you look at pykakasi
's GitHub Issu, there was a bug in the past that caused the error KeyError: 'pykakasi\hepburnhira2.pickle'
, but it has already been fixed.Also, I have tried installing the latest version of pykakasi
, but there is no problem.
Just in case, uninstall the currently installed pykakasi
and then
pip uninstall pykakasi
I think it will work no matter how you install it.
// From PyPI
pip install pykakasi
// From GitHub repository
pip install git + https://github.com/miurahr/pykakasi
// From GitHub release
pip install https://github.com/miurahr/pykakasi/archive/v0.93.zip
© 2024 OneMinuteCode. All rights reserved.