coccoc / coccoc-tokenizer

high performance tokenizer for Vietnamese language
GNU Lesser General Public License v3.0
393 stars 123 forks source link

Need help when install libary for python in conda environment #25

Closed LittleCuteBug closed 1 year ago

LittleCuteBug commented 1 year ago

Dear all, I've some issues when trying to install the CocCocTokenizer library for python 3.8 in a conda environment. I've tried:

but none of those solutions help me to include the coccoctokenizer in python:

from CocCocTokenizer import PyTokenizer
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'PyTokenizer' from 'CocCocTokenizer' (unknown location)
anhducle98 commented 1 year ago

You can try install the files manually to your python env site-packages:

$ cp build/python/lib/python3.10/site-packages/CocCocTokenizer.* /home/huyqnguyen/anaconda3/envs/py3.8/lib/python3.8/site-packages
LittleCuteBug commented 1 year ago

Dear @anhducle98, thanks for your suggestion, but after I tried to copy the file CocCocTokenizer-1.4-py3.8-linux-x86_64.egg in the directory coccoc-tokenizer/build/python/lib/python3.8/site-packages/ to the python env site-packages /home/huyqnguyen/anaconda3/envs/py3.8/lib/python3.8/site-packages/ but it's still not work. I've also tried rename the directory to CocCocTokenizer.egg and it's not work too.

anhducle98 commented 1 year ago

Sorry. I meant copying the .so and .py files:

$ cp build/python/lib/python3.8/site-packages/CocCocTokenizer-1.4-py3.8-linux-x86_64.egg/CocCocTokenizer.* /home/huyqnguyen/anaconda3/envs/py3.8/lib/python3.8/site-packages/
LittleCuteBug commented 1 year ago

Thanks for your support, it works beautifully, I'll close this issue now