Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nmslib support matrix (#524) #2

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,53 @@ Take a look below in the "Setting up a virtual environment" section if you need
Additionally, scispacy uses modern features of Python and as such is only available for **Python 3.6 or greater**.


### Installation note: nmslib
Over the years, installing nmslib has becomes quite difficult. There are a number of GitHub issues on scispaCy and the nmslib repo itself about this. This matrix is an attempt to help users install nmslib in whatever environment they have. I don't have access to every type of environment, so if you are able to test something out, please open an issue or pull request!

| | Windows 11 | Windows Subsystem for Linux | Mac M1 | Mac M2 | Mac M3 | Intel Mac |
|---------------|------------|----------------------------|---------|---------|---------|-----------|
| Python 3.8 | ✅ | ✅ | 💻 | ❓ | ❓ | ❓ |
| Python 3.9 | ❌🐍 | ✅ | 💻 | ❓ | ❓ | ❓ |
| Python 3.10 | ❌🐍 | ✅ | ❓ | ❓ | ❓ | ✅ |
| Python 3.11 | ❌🐍 | ❌🐍 | ❓ | ❓ | ❓ | ❌ |
| Python 3.12 | ❌🐍 | ❌🐍🧠 | ❓ | ❓ | ❓ | ❓ |


✅ = works normally with pip install of scispacy

❌ = does not work normally with pip install of scispacy

🐍 = can be installed with `mamba install nmslib`

💻 = can be installed with `CFLAGS="-mavx -DWARN(a)=(a)" pip install nmslib`

🧠 = can be installed with `pip install nmslib-metabrainz`

❓ = unconfirmed

Other methods mentioned in GitHub issues, but unconfirmed what versions they work for:
- `CFLAGS="-mavx -DWARN(a)=(a)" pip install nmslib`
- `pip install --no-binary :all: nmslib`
- `pip install --upgrade pybind11` + `pip install --verbose 'nmslib @ git+https://github.com/nmslib/nmslib.git#egg=nmslib&subdirectory=python_bindings'`

#### Setting up a virtual environment

[Conda](https://conda.io/) can be used set up a virtual environment with the
[Mamba](https://mamba.readthedocs.io/en/latest/) can be used set up a virtual environment with the
version of Python required for scispaCy. If you already have a Python
environment you want to use, you can skip to the 'installing via pip' section.

1. [Follow the installation instructions for Conda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html?highlight=conda#regular-installation).
1. [Follow the installation instructions for Mamba](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html).

2. Create a Conda environment called "scispacy" with Python 3.9 (any version >= 3.6 should work):

```bash
conda create -n scispacy python=3.9
mamba create -n scispacy python=3.10
```

3. Activate the Conda environment. You will need to activate the Conda environment in each terminal in which you want to use scispaCy.
3. Activate the Mamba environment. You will need to activate the Conda environment in each terminal in which you want to use scispaCy.

```bash
source activate scispacy
mamba activate scispacy
```

Now you can install `scispacy` and one of the models using the steps above.
Expand Down