Dependency issue of scipy
shahad-mahmud 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.
Hi @shahad-mahmud ,
Please test with the exact version and send PR.
I will merge it shortly after reviewing it.
Thanks for the findings
Hi @shahad-mahmud ,
I have tried to install bnlp_toolkit, and it's working fine. maybe the problem is from your end.
What Python version you are using?
Here is the notebook, I have tried.
https://colab.research.google.com/drive/1SRfaW7J0S4uLpcsazjf3sHqDv8395UNs?usp=sharing
Please check and let me know what is the main issue for installation in your side.
Generally, a lower version is installed in Colab. For example, if you check the version of scipy
with ! pip freeze | grep scipy
, you will find that scipy==1.11.4
is installed. However, if you upgrade the scipy
version with !pip install -U scipy
and then try to use bnlp
you will face the error.
Here is a Colab notebook:
https://colab.research.google.com/drive/1ibEG4aCSMwg5lkM2XhBPA0Xs_qZArrR9?usp=sharing
You can reproduce this error with a fresh conda environment as well. I encounter this error while using bnlp in a docker. All packages were freshly installed to the latest versions and I was using Python 3.10.
Understand.
Okay, I will check with your pin version and merge it shortly.
Thanks again for the findings.