x-tabdeveloping / topicwizard

Powerful topic model visualization in Python
https://x-tabdeveloping.github.io/topicwizard/
MIT License
101 stars 13 forks source link

I can't import topicwizard #17

Closed Karrol closed 1 year ago

Karrol commented 1 year ago

I don't know how to handle this problem. ask for help. Thank you. here is the error information: File d:\software\anaconda\anaconda\envs\topicmodel\lib\site-packages\topicwizard__init__.py:1 ----> 1 from topicwizard.app import get_dash_app, load, load_app, visualize 2 from topicwizard.compatibility.bertopic import bertopic_pipeline 3 from topicwizard.compatibility.gensim import gensim_pipeline

File d:\software\anaconda\anaconda\envs\topicmodel\lib\site-packages\topicwizard\app.py:220 214 app = load_app(filename, exclude_pages=exclude_pages) 215 return run_app(app, port=port) 218 def split_pipeline( 219 vectorizer: Any, topic_model: Any, pipeline: Optional[Pipeline] --> 220 ) -> tuple[Any, Any]: 221 """Check which arguments are provided, 222 raises error if the arguments are not satisfactory, and if needed 223 splits Pipeline into vectorizer and topic model.""" 224 if (vectorizer is None) or (topic_model is None):

TypeError: 'type' object is not subscriptable

x-tabdeveloping commented 1 year ago

Oh yeah I think it must be you having an older version of Python, can you try with a newer one? (3.9 and up should be fine.) If it's not an option I can try to fix the package for older versions, but I would orefer if we could stick to 3.9 and up

Karrol commented 1 year ago

Thank you very much. I created a new virtual environment with python 3.9 and it works well . I found a DeprecationWarning that
textsize is deprecated and will be removed in Pillow 10 (2023-07-01), it suggests to use textbbox or textlength instead. hope it will help. Thank you for your good job~

x-tabdeveloping commented 1 year ago

Thanks for the kind words :D I think it's probably a downstream dependency, I'm guessing wordcloud, but I will make sure to check it out.