Annoy fails to build on Windows due to Microsoft Visual C++ 14.0
Author: basisvectorsCreated Apr 26, 2024Updated Oct 13, 2025
Hi, Annoy installed without any issues on my WSL Ubuntu but when I tried to install it on windows it failed Here's the log
PS > py -3.9 -m pip install annoy
Looking in indexes: https://pypi.org/simple, https://pypi.ngc.nvidia.com
Collecting annoy
Downloading annoy-1.17.3.tar.gz (647 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 647.5/647.5 kB 13.6 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: annoy
Building wheel for annoy (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for annoy (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-39
creating build\lib.win-amd64-cpython-39\annoy
copying annoy\__init__.py -> build\lib.win-amd64-cpython-39\annoy
copying annoy\__init__.pyi -> build\lib.win-amd64-cpython-39\annoy
copying annoy\py.typed -> build\lib.win-amd64-cpython-39\annoy
running build_ext
building 'annoy.annoylib' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for annoy
Failed to build annoy
ERROR: Could not build wheels for annoy, which is required to install pyproject.toml-based projectsI would try installing VC++14.0 build tools but that is a 6+GB install.
Do you have any suggestions to resolve this? Would it be possible to get pre-built wheels for python 3.9 or 3.10?
Please let me know, thanks!
Source: spotify/annoy