nlp-uoregon / trankit

Trankit is a Light-Weight Transformer-based Python Toolkit for Multilingual Natural Language Processing
Apache License 2.0
724 stars 99 forks source link

ImportError: cannot import name 'Pipeline' from partially initialized module 'trankit' #44

Closed EagleEyeKestrel closed 2 years ago

EagleEyeKestrel commented 2 years ago

Hi. After I install trankit using pip, run this simple code to test trankit:

from trankit import Pipeline

p = Pipeline('auto')
output = p.tokenize('xxxxx')

And I see this error: Traceback (most recent call last): File "/Users/jiluyang/Desktop/trankit.py", line 1, in from trankit import Pipeline File "/Users/jiluyang/Desktop/trankit.py", line 1, in from trankit import Pipeline ImportError: cannot import name 'Pipeline' from partially initialized module 'trankit' (most likely due to a circular import) (/Users/jiluyang/Desktop/trankit.py) So why does it occur and how can I fix it? I have tried trankit 1.1.0 and 1.1.1, this error occurs in both versions. Thx !

EagleEyeKestrel commented 2 years ago

oh I use wrong filename.... I see , sorry