Conda environments are a common way to keep Python machine learning packages separate from the system Python and from other projects. Installing Sentence Transformers from conda-forge keeps the library, PyTorch, Transformers, and numerical dependencies in one solver-managed environment for embedding work.
The conda-forge package provides the base Sentence Transformers text embedding library. Pip-style extras such as image, audio, video, ONNX, and OpenVINO are not Conda extras, so keep this environment focused on the standard package unless the project has a separate extras plan.
Use a fresh environment instead of installing into base. Keeping the solve on conda-forge avoids mixing incompatible package channels, and a small model smoke test confirms the installed package can load a public model and return embeddings.
$ conda create --yes --name st-conda --channel conda-forge --override-channels python=3.11 sentence-transformers
--override-channels keeps this solve on conda-forge for the new environment. Use another supported Python version only when the project already standardizes on it.
$ conda activate st-conda
$ python -c "import sentence_transformers; print(sentence_transformers.__version__)" 5.6.0
The exact version changes as conda-forge publishes new builds. The import must run from the activated environment.
$ python - <<'PY'
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2")
embeddings = model.encode([
"Conda installed Sentence Transformers",
"Embeddings are ready",
])
print(embeddings.shape)
PY
##### snipped
(2, 384)
The first model load may download files from Hugging Face. The shape shows two input texts encoded with the 384-dimensional all-MiniLM-L6-v2 model.
Related: Set the Sentence Transformers cache directory