Home>

I want to use the module sudachipy in an environment built on Google Colaboratory.
The following error is displayed because import does not seem to be successful.

Error message
ImportError Traceback (most recent call last)
<ipython-input-***>in<module>()
---->1 from sudachipy import tokenizer
      2 from sudachipy import dictionary
ImportError: cannot import name 'tokenizer'


The part of *** was written with alphanumeric characters, but because it was not possible to determine whether it could be disclosed to the general public, it was turned over.

Applicable source code
! pip install -e git + git: //github.com/WorksApplications/[email protected]#egg=SudachiPy
! pip list | grep sudachipy
from sudachipy import tokenizer
from sudachipy import dictionary

-Moved manually because the installed module 'sudachipy' has a different path from other installed modules
Path where other modules are installed: /usr/local/lib/python3.6/dist-packages
Path where sudachipy is installed:/content/src/sudachipy
Result: A similar error occurred

Specify the import path
import sys
sys.path.append ('/ content/src/sudachipy')
from sudachipy import tokenizer
from sudachipy import dictionary
Result: A similar error occurred

If another module was installed with the command! pip install [module name], it was available.
I thought it might be a path specification problem, but it couldn't be solved.

Supplemental information (FW/tool version etc.)

Use python 3.6 with google colab

Please let me know if you have any additional information.