Install & Compatibility
Where this runs
tested against v1.0.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.11
✕ build_error
✓ 9.65s
py 3.12
✕ build_error
✓ 9.85s
py 3.13
✕ build_error
✓ 9.9s
py 3.9
✕ build_error
✕ build_error
291MB installed
● package 291MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
TSNE
✓ from openTSNE import TSNE
✗ from opentsne import TSNE
Library uses camelCase 'openTSNE' as package name, not lowercase.
TSNEEmbedding
✓ from openTSNE import TSNEEmbedding
Affinity
✓ from openTSNE.affinity import Affinity
MultiscaleMixture
✓ from openTSNE.affinity import MultiscaleMixture
Default affinity model since v0.6.2.
Basic t-SNE embedding using default multiscale mixture affinity.
from openTSNE import TSNE
from sklearn.datasets import load_iris
import numpy as np
iris = load_iris()
X = iris.data
y = iris.target
# Initialize with default parameters (multiscale perplexity = [50, 500])
tsne = TSNE(random_state=42, verbose=False)
embedding = tsne.fit(X)
print(embedding.shape) # (150, 2)
opentsne --version
Errors
Common errors & fixes
AttributeError: module 'openTSNE' has no attribute 'TSNE'
Importing with wrong case; the package name is 'openTSNE' but the module is also 'openTSNE', so `import openTSNE` works, but `from openTSNE import TSNE` is needed. Common mistake: using `import opentsne` (lowercase) which is not a standard alias.
fixUse `from openTSNE import TSNE` or `import openTSNE as tsne`.
ImportError: cannot import name 'TSNEEmbedding' from 'openTSNE'
TSNEEmbedding is not directly importable from the top-level openTSNE; it resides in the `openTSNE.embedding` submodule in older versions, but in v1.x it is available from `openTSNE` directly. This error occurs when using an older version and trying the new import path.
fixFor openTSNE >=1.0.0: `from openTSNE import TSNEEmbedding`. For older versions (0.x): `from openTSNE.embedding import TSNEEmbedding`.
ValueError: The 'perplexity' parameter must be an integer or a list of integers.
openTSNE v0.6.2+ expects multiscale perplexity as a list (default [50, 500]) but passing a single float or integer incorrectly can trigger this error.
fixPass `perplexity=30` for single perplexity, or `perplexity=[50, 500]` for multiscale.
Upgrade
Version history
1.0.4latest on PyPI · released Oct 27, 2025
Audit
Dependencies
numpyrequiredCore dependency for array operations
scipyrequiredSparse matrix and distance computations
scikit-learnoptionalOptional for spectral initialization and metrics
annoyrequiredDefault nearest neighbor search (bundled)
pynndescentoptionalAlternative nearest neighbor search
numbaoptionalOptional accelerator for gradient computations (not used by default since v0.4.0)