sagorbrur / bnlp

BNLP is a natural language processing toolkit for Bengali Language.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dependency issue of scipy

shahad-gt opened this issue · comments

With the recent release of scipy==1.13.0, some scipy.linalg packages including triu is removed. So, POS tagging with a fresh installation of bnlp-toolkit results in the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/shahad/miniconda3/envs/gen10/lib/python3.10/site-packages/bnlp/__init__.py", line 12, in <module>
    from bnlp.embedding.word2vec import (
  File "/home/shahad/miniconda3/envs/gen10/lib/python3.10/site-packages/bnlp/embedding/word2vec.py", line 13, in <module>
    from gensim.models import Word2Vec
  File "/home/shahad/miniconda3/envs/gen10/lib/python3.10/site-packages/gensim/__init__.py", line 11, in <module>
    from gensim import parsing, corpora, matutils, interfaces, models, similarities, utils  # noqa:F401
  File "/home/shahad/miniconda3/envs/gen10/lib/python3.10/site-packages/gensim/corpora/__init__.py", line 6, in <module>
    from .indexedcorpus import IndexedCorpus  # noqa:F401 must appear before the other classes
  File "/home/shahad/miniconda3/envs/gen10/lib/python3.10/site-packages/gensim/corpora/indexedcorpus.py", line 14, in <module>
    from gensim import interfaces, utils
  File "/home/shahad/miniconda3/envs/gen10/lib/python3.10/site-packages/gensim/interfaces.py", line 19, in <module>
    from gensim import utils, matutils
  File "/home/shahad/miniconda3/envs/gen10/lib/python3.10/site-packages/gensim/matutils.py", line 20, in <module>
    from scipy.linalg import get_blas_funcs, triu
ImportError: cannot import name 'triu' from 'scipy.linalg' (/home/shahad/miniconda3/envs/gen10/lib/python3.10/site-packages/scipy/linalg/__init__.py)

It can be reproduced with a fresh installation of the toolkit and the expression from bnlp import BengaliPOS.

Pinning the version of scipy==1.12.0 in the setup.py script can be an easy solution. I can help to resolve this issue and create a PR.