polm / fugashi

A Cython MeCab wrapper for fast, pythonic Japanese tokenization and morphological analysis.
MIT License
389 stars 31 forks source link

Failed initializing MeCab #78

Closed eye-zhuk closed 1 year ago

eye-zhuk commented 1 year ago

RuntimeError: Failed initializing MeCab. Please see the README for possible solutions:

https://github.com/polm/fugashi

If you are still having trouble, please file an issue here, and include the ERROR DETAILS below:

https://github.com/polm/fugashi/issues

issueを英語で書く必要はありません。 what should i do here?

polm commented 1 year ago

So the error message you have copied and pasted mentions ERROR DETAILS. Did your output not include ERROR DETAILS? It should look a little like this:

------------------- ERROR DETAILS ------------------------
arguments: [b'fugashi', b'-C', b'-d', b'/aasdf']
param.cpp(69) [ifs] no such file or directory: /aasdf/dicrc
----------------------------------------------------------

Please also check the common issues. For example, did you install a dictionary like unidic-lite?

eye-zhuk commented 1 year ago

yes the error code looks like this

arguments: [b'fugashi', b'-C', b'-d', b'C:\\Users\\Me\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\unidic_lite\\dicdir', b'-r', b'C:\\Users\\Me\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\unidic_lite\\dicdir\\mecabrc']
viterbi.cpp(50) [tokenizer_->open(param)] tokenizer.cpp(110) [sysdic->open (create_filename(prefix, SYS_DIC_FILE).c_str())] dictionary.cpp(94) [(magic ^ DictionaryMagicID) == dmmap_->size()] dictionary file is broken: C:\Users\Me\AppData\Local\Programs\
polm commented 1 year ago

Please read the markdown formatting guide.

The error says your dictionary is broken. Can you try reinstalling unidic lite?

Also please provide a sample of the code that causes this. mmap related errors are often related to creating too many instances of the Tagger.

polm commented 1 year ago

Closing due to lack of response.