asreview / asreview

Active learning for systematic reviews

Home Page:https://asreview.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ASReview doesn't recognize the installation of Sentence_transformers

Mitch038 opened this issue · comments

Describe the bug
I am trying to use the combination of Sentence BERT and neural network, but the system displays an Import Error. I have installed sentence-transformers and Tensorflow correctly, but it is not working

To Reproduce
I followed the instructions to install the extensions and create the new project. After the warm-up, I receive constantly the same message: ImportError: Install sentence-transformers package to use Sentence BERT.

Screenshots
image

Version information

  • OS: Microsoft windows Version 10.0.19045.3693
  • ASReview version 1.2.1

Hi @Mitch038 ! Let's see if we can figure out why this is happening!

Can you tell me how you are certain that your installation of sentence-transformers and tensorflow is correct?

What is the output of pip freeze?

Are you sure the installation of those packages is on the same python environment as you are running asreview from?

JT^

PS. Did you install using pip install asreview[all]?

Can you report your Python version? Python 3.12? Unfortunately Python 3.12 is still not supported by tensorflow. You might not even notice that the installation fails. In that case, please downgrade to Python 3.11.

Hi,

Thanks for your reactions!

I tried to install via several ways in the cmd window:
pip install tensorflow
pip install sentence_transformers
pip install asreview[all]
pip install asreview[tensorflow]
pip install asreview[sentence_transformers]

the output of pip freeze is as follows:
asreview==1.2.1
asreview-datatools==1.1.1
attrs==23.1.0
blinker==1.6.3
cattrs==23.1.2
certifi==2023.7.22
cffi==1.16.0
charset-normalizer==3.3.0
click==8.1.7
colorama==0.4.6
datahugger==0.10.3
dill==0.3.7
et-xmlfile==1.1.0
filelock==3.12.4
Flask==3.0.0
Flask-Cors==4.0.0
gevent==23.9.1
gitignorefile==1.1.2
greenlet==3.0.0
idna==3.4
itsdangerous==2.1.2
Jinja2==3.1.2
joblib==1.3.2
jsonpath-ng==1.6.0
jsonschema==4.19.1
jsonschema-specifications==2023.7.1
MarkupSafe==2.1.3
natsort==8.4.0
numpy==1.26.0
openpyxl==3.1.2
pandas==2.1.1
platformdirs==3.11.0
ply==3.11
pycparser==2.21
python-dateutil==2.8.2
pytz==2023.3.post1
referencing==0.30.2
requests==2.31.0
requests-cache==1.1.0
rispy==0.7.1
rpds-py==0.10.4
scikit-learn==1.3.1
scipy==1.11.3
scisort==0.5.3
scitree==0.5.3
seedir==0.4.2
setuptools==68.2.2
six==1.16.0
threadpoolctl==3.2.0
tqdm==4.66.1
tzdata==2023.3
url-normalize==1.4.3
urllib3==2.0.6
Werkzeug==3.0.0
xlrd==2.0.1
zope.event==5.0
zope.interface==6.1

I am not sure that the installation of those packages is on the same python environment as I am running asreview from as I used the cmd window, but the python version indeed is 3.12. Can I use the cmd window to downgrade?

Looking at the output of pip freeze I can see the packages failed to install, and I think @J535D165 is right.

Personally, I'd uninstall python 3.12 and install python 3.11, which is known to work. It can be found here:
https://www.python.org/downloads/release/python-3117/

Make sure to check the "add to path" checkbox during the installation!

Another option is install python 3.8. This is our recommended version. Sadly, python does not officially provide installers, but installers can be found here:
https://github.com/adang1345/PythonWindows/tree/master/3.8.18

JT^

Will uninstalling python 3.12 not result in my AS Review results getting lost?

It will not! ASReview stores its projects at a different location. But if you're still worried, backing-up projects is always an option!

See https://asreview.readthedocs.io/en/stable/manage.html