Spaces:
Running
senetence-transformers having issue with python3.11 on mac
python3 --version
Python 3.11.6
pip install -U sentence-transformers
Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/site-packages (from requests->huggingface-hub>=0.20.0->sentence-transformers) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/site-packages (from requests->huggingface-hub>=0.20.0->sentence-transformers) (3.6)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/site-packages (from requests->huggingface-hub>=0.20.0->sentence-transformers) (2.0.7)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/site-packages (from requests->huggingface-hub>=0.20.0->sentence-transformers) (2024.2.2)
Requirement already satisfied: mpmath<1.4.0,>=1.1.0 in /Users/vikrant/Library/Python/3.11/lib/python/site-packages (from sympy->torch>=1.11.0->sentence-transformers) (1.3.0)
Downloading sentence_transformers-3.2.1-py3-none-any.whl (255 kB)
Installing collected packages: sentence-transformers
Attempting uninstall: sentence-transformers
Found existing installation: sentence-transformers 3.2.0
Uninstalling sentence-transformers-3.2.0:
Successfully uninstalled sentence-transformers-3.2.0
Successfully installed sentence-transformers-3.2.1
== demo.py==
from sentence_transformers import SentenceTransformer
model = SentenceTransformer('paraphrase-MiniLM-L6-v2')
sentence = ['This framework generates embeddings for each input sentence']
embedding = model.encode(sentence)
python3 demo.py
Traceback (most recent call last):
File "/Users/vikrant/SourceCode/VectorSearch/demo.py", line 1, in
from sentence_transformers import SentenceTransformer
ModuleNotFoundError: No module named 'sentence_transformers'
Hello!
Usually this means that the pip
and python3
refer to different Python installations. Could you check python3 -m pip show sentence_transformers
for example? That should be the pip
that corresponds to python3
.
- Tom Aarsen